cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in generated STM32DMA class on newest version 4.17.0

jimmii
Senior II

Hello

Just as an information; (@Alexandre RENOUX​ )

You added the function OSWrappers::taskYield() when using L8 images.

TaskYield() is called in the function setupDataCopy.

The problem: setupDataCopy is also called from ISR as you know, TaskYield() is not allowed to be called from ISR and you get Thread-Errors.

I think this should be fixed in the next release...

Cheers, Roman

1 ACCEPTED SOLUTION

Accepted Solutions

For someone who is using KeilRTX, following function does the same for M3/M7 processors:

// Only call osThreadYield() when not in ISR Context
if((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) == 0) {
	osThreadYield();
}

View solution in original post

12 REPLIES 12
Romain DIELEMAN
ST Employee

Hi,

Thank you for reporting this. Could you share your project by any chance ? So that I can forward it to the Framework team. We did try projects using L8 images during our pre-release tests but will further investigate.

Are you working with a TouchGFX Board Setup or on a custom hardware ?

/Romain

0693W00000BdFFEQA3.pngHi,

unfortunately I cannot share our project. I'm working on a custorm HW.

I attached the stack trace. Maybe it helps.

Please let me know if you need any more information.

Romain DIELEMAN
ST Employee

Hi again,

I've been told 2 fixes you could try:

1) In OSWrappers.cpp change taskYield to only call osThreadYield if not in interrupt context, using this function:

portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void )

2) Change setupDataCopy to not call yield if in interrupt context, or never call yield.

/Romain

For the time being I already went with option 2 without calling yield as with Keil RTX, Option 1 is not working as there is no such function.

So for now for me it's working...

For someone who is using KeilRTX, following function does the same for M3/M7 processors:

// Only call osThreadYield() when not in ISR Context
if((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) == 0) {
	osThreadYield();
}

What OS are you using by the way ? How is taskYield() in OSWrappers.cpp implemented in your project ? (just to check). CMSIS2 for FreeRTOS can handle taskyield from interrupt:

osStatus_t osThreadYield (void) {

osStatus_t stat;

if (IS_IRQ()) {

stat = osErrorISR;

} else {

stat = osOK;

taskYIELD();

}

return (stat);

}

But you are correct, it is not proper code. It will be fixed in the next release 👍

/Romain

I'm using Keil RTX and I'm calling osThreadYield(); But the Keil "version" does not allow calling from ISR.

Perfect.

/jimmii

Could you share what bit depth you have ? and what mcu ?

/Romain

  • 16bit Color Depth
  • STM32H753

/jimmii