10 years, 7 months ago.

mbed-rtost trouble(RtosTimer.start)

Hi all,

I use mbed-rtos. I used two mbeds, but malfunction occurred in one mbed. I use same bin.

It is start of RtosTimer to produce malfunction. LED1 and LED3 LED become in condition to flash on and off in turn when they call start api.(Probably LED14 and LED23 flash on and off in turn.)

I updated firm ware of mbed which produced abnormality, but was not improved. If you have any associated information, please teach me it.

best regards, - yamyam

(2013/09/09 18:36 JST) I add informations. Is it trouble of the hardware?

  • Abnormality does not occur by the reset.
  • In the first time when I switched it on, malfunction occurs.
  • LED2 and LED4 removed it (to use a counter of the hardware)
  • I tried it in three mbed, but the abnormality occurred only in one.

2 Answers

10 years, 7 months ago.

Maybe the stack for your thread isn't large enough and an overflow is triggering the mbed_die() scenario?

Now why it would die on one device and not another is a good question. Do you read in any data from the LocalFileSystem which might be different on the two devices and therefore cause a slightly different code path to be taken or a different amount of memory to be used?

If you could reproduce with a build compiled via an offline compiler, you could create a build with symbols and then attach a debugger to observe the callstack when this occurs. That would probably shed a great deal of light on the cause of your problem.

delete....

posted by Yam Yam 11 Sep 2013

If it is too difficult to install and use an offline compiler, we could try debugging the online version. To do this, you would want to follow the steps on this notebook page that I just created: http://mbed.org/users/AdamGreen/notebook/crashdump/

I then need you to post the resulting text sent to the serial port and your .bin program file.

posted by Adam Green 11 Sep 2013

Thank you for your reply.

I looked at the page. Is there the sample of how to use?

posted by Yam Yam 17 Sep 2013

Steps to use:

  • Create a new file in your existing project. You can name it DumpStack.cpp as I did.
  • Copy the code from my notebook page and paste it into the C++ source file you just created.
  • Rebuild your project and run it.
  • If the problem still occurs, you should see some extra text dumped to your serial port via printf().

Example of text sent to serial port when crash is detected:

mbed_die @ 000021E5
10007BF8: 0x00000000 0x000021A7 0x6EE3B699 0xF0E52369  
10007C08: 0xB2B3C646 0x4ECB4F65 0x5A48DC46 0x5577EF33  
... I deleted some text here to shorten sample.
10007FE8: 0x00003E14 0x00000000 0x0000340D 0x000001BF  
10007FF8: 0x0000229E 0x01000000 


You only need to include the code from my notebook page in your project. You don't need to call anything from your code to initialize it. Just having the code in your project should be enough.

-Adam

posted by Adam Green 17 Sep 2013

Thank you for your answer.

I added Dumpstack.cpp. mbed freezes when I start a program at a power supply. mbed freezes while outputting printf. At that time, the debugging message was not output. I work without a problem when it starts from reset. I think that how to use Dumpstack.cpp does not have any problem. Will the output of the serial(USB) have a problem? -gon

posted by Yam Yam 01 Oct 2013
Yam Yam
poster
10 years, 7 months ago.

Thank you for a reply.
No, I file it and do not operate it. The operation going for is as follows.

  1. baud setting in MODSERIAL
  2. I set rxCallback of MODSERIAL
  3. io operation (including OLED, the GPS)
  4. io operation (I display a letter to OLED)

    I carry out a code as follows immediately after this.

Thread t1(thread_idle);
...
RtosTimer thread_idle_rtos_timer1(timer_idle, osTimerPeriodic, (void *)0);
...
thread_idle_rtos_timer1.start(500);

I stop at a stage of this start. The off-line compiler is not installed. I think about the installation.