Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 10 months ago.
mbed RTOS not exported correctly to KDS?
I have an mbed-rtos project for the K22F board that works fine when I compile from mbed.org and download. I exported it and compiled it locally using Kinetis Design Studio (KDS). It appears that Thread::wait() and the thread utilities are not working at all. My main loop with a 1000 msec delay is basically blasting data at 9600 baud as fast as it can.
Does anyone know if mbed rtos for Kinetis is fundamentally broken and I should restart using something different?
Thank you for any assistance!
If you post a link to the published program that exhibits this problem it will be easier to track down root cause.
posted by Sam Grove 29 Dec 2014I did confirm that wait(1.0) works, while Thread::wait(1000) does not. :(
posted by Thor Hall 29 Dec 2014Can you publish a program and link to it? If people are going to help you it'd be nice to give them a chance to start from the same program that you are
posted by Sam Grove 30 Dec 2014As there are proprietary design elements in the code, I can't quite post what I have. I might be able to come up with a paired down version. However, all one needs to do is try Thread::wait() compiled in KDS and you should see the same behavior.
posted by Thor Hall 30 Dec 2014I have demonstrated the issue in a simpler file. In this app the Thread::wait() call results in a hard fault handler call, while in the original is simply returned immediately
Example
Went back and discovered that somehow the build must not have included all of the right mbed-rtos libraries, though I should think the linker should have errored out. When I corrected that, the thread call simply returns immediately like it did in the original application. :(
posted by Thor Hall 30 Dec 2014More status - I followed the call to Thread::wait() using KDS and it appears that the rtos thinks the call is being made from an interrupt routine, which it certainly is not. This same code works from the mbed compiler, so it looks like some housekeeping chores are not being handled correctly when everything is exported.
posted by Thor Hall 30 Dec 2014Please publish a program to your account and share the link. There are dependencies, mbed, mbed-rtos and many versions of each. That is the best way to get help in the shortest time frame.
http://developer.mbed.org/handbook/Publishing-code
BTW - from your example above the RTOS doesn't appear to be used (ie no threads or RTOS components started) so I wouldnt expect Thread::wait to work.
If it was a Thread then you would use Thread::wait
posted by Sam Grove 31 Dec 2014