I’m working on an app where I have an MCU (currently STM32 Nucleo-U083RC) connected via I2C to a Notecard. At present the app is very simple, being a minor modification to the STM “FreeRTOS_Semaphore_LowPower” sample. There’s a main thread which is a loop which waits on a binary semaphore. There’s an ISR which releases the semaphore at which point the main thread takes an action (flashes the user LED on the Nucleo board) and then goes back to sleep. So far, this works as expected. However, if I extend the main thread action so that it makes a Notecard API request (currently card.version) then the application freezes. I have determined that this is something (somehow) to do with the binary semaphore used to control the main loop. At the top of the loop, the code has “osSemaphoreAcquire(BinarySemaphoreHandle, osWaitForever)”, and - if and only if the previous cycle of the main loop has made the Notecard request - this call never returns, and so the code is frozen. Immediately before the call to osSemaphoreAcquire, the code executes “osSemaphoreGetCount (BinarySemaphoreHandle)”. If I run the code with the Notecard request commented out, and inspect the result of this call, it is always zero, which is what I would expect. However, if I run the code including the Notecard API call then this value is always non-zero (in fact always seems to be 339). By the way, the Notecard API request does succeed.
I’m pretty new to FreeRTOS, and indeed to the Blues world. I’d be very grateful if anyone has any insight into how to correct this situation. Doing a search in the forum, I saw that @bsatrom mentioned back in August 2023 that there might be some examples for FreeRTOS on the way, but I haven’t managed to locate anything…