‎2022-04-23 12:57 PM
Hello everyone,
I just started messing with FREERTOS and encountered odd behaviour.
When I run my code, everything seems to work. However, when I run debug the osKernelStart() fails.
Any ideas what causes this and how I can fix it?
Addtional info: sometimes restarting the CubeIDE works, but just once.
Thanks!
Peter
‎2022-04-23 02:12 PM
what is the error?
‎2022-04-23 04:00 PM
More details, please. Which STM32, board; which CubeIDE version?
‎2022-04-24 04:21 AM
I am using CubeIDE version 1.4.2.
In osKernelStart()
if (IS_IRQ()) {
stat = osErrorISR;
}
executes and therefore the scheduler never starts.
The board I am using is the NUCLEO L476RG.
‎2022-04-24 04:31 AM
Don't recall the details, but once there were issues with wrong interrupt priorities set by STM32CubeIDE. Try upgrading to the latest version and regenerate all code.
hth
KnarfB
‎2022-04-24 10:37 AM
Thanks for the hint, I will update CubeIDE (and to be safe) CubeMX to the newest version and report back!
‎2022-04-24 02:28 PM
Updated CubeIDE, CubeMX, STLINK, generated code. Problem still there.
‎2022-04-24 07:07 PM
Try to understand why IS_IRQ() evaluates to true. It obviously should not.
You're using CMSIS_OS2.
‎2022-04-25 06:04 PM
It's the other line of that code for ARMv7-M. 😊
And it evaluates to true, when it's called from an interrupt context, which is clearly forbidden for osKernelStart() function.
‎2022-04-27 01:22 AM
First off, thanks so much for all your replys, really apreciate it!
Yes, I am using CMSIS_OS2.
Can it be, that the a breakpoint kind of acts like an interrupt in this case? Just to reiterate, it works when just running the program, only when using debug mode it fails to start the kernel.