7 years, 9 months ago.

timeline for Serial or SPI async on ST Micro M4?

Anyone have any idea when async Serial might be supported on ST Micro processors? In particular I am using an STM32F446 (Arm Cortex M4). I could *really* use it. Same goes for async SPI.

Basically, I need to run an AnalogOut @ 100 KHz without any time jitter and send some UART and SPI messages concurrently. I tried the mbed RTOS but it seems to always swap threads every 5 ms no matter how I play with osPriority and/or calling Thread::yield().

Thanks!

Elwood Downey Steward Observatory University of Arizona

1 Answer

7 years, 9 months ago.

Hi Elwood,

In mbed OS 3 we have async SPI and async serial, which I know works (as I have used it :-)). According to the docs there should be async SPI etc. in mbed OS 5.1 as well (see DEVICE_SPI_ASYNCH). If you see thread swapping happening every 5 ms. that'd be a bug, so please file it here.

Hi Jan, thanks much for your response.

I was not very clear. When I called the Serial async methods read() and write() I would get a compile error "Platform not compatible with Low Power APIs for Serial". But no worries, I found Sam Grove's BufferedSerial and it solves my problem.

Regarding Thread granularity, it was my error in thinking. I had two threads and main() was sitting in wait(10000). I was assuming things worked like POSIX threads where this would not be schedulable, but now I understand it is in mbed. So now I just have one thread, with the other work directly in main(). The two each call yield() and bounce back and forth nicely.

Best regards,

Elwood

posted by Elwood Downey 10 Aug 2016

Alright, clear. Thanks for the update :-).

posted by Jan Jongboom 11 Aug 2016