cancel
Showing results for 
Search instead for 
Did you mean: 

Using CubeIDE Debub with FREERTOS gives error in osKernelStart

PSmol.1
Associate II

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

10 REPLIES 10
KnarfB
Principal III

what is the error?

Pavel A.
Evangelist III

More details, please. Which STM32, board; which CubeIDE version?

PSmol.1
Associate II

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.

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

Thanks for the hint, I will update CubeIDE (and to be safe) CubeMX to the newest version and report back!

Updated CubeIDE, CubeMX, STLINK, generated code. Problem still there.

Try to understand why IS_IRQ() evaluates to true. It obviously should not.

You're using CMSIS_OS2.

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.

PSmol.1
Associate II

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.