Skip to main content
jimmii
Senior II
July 9, 2021
Solved

Bug in generated STM32DMA class on newest version 4.17.0

  • July 9, 2021
  • 12 replies
  • 2415 views

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

This topic has been closed for replies.
Best answer by jimmii

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();
}

12 replies

Romain DIELEMAN
ST Employee
July 9, 2021

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

jimmii
jimmiiAuthor
Senior II
July 9, 2021

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
July 9, 2021

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

jimmii
jimmiiAuthor
Senior II
July 9, 2021

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...

jimmii
jimmiiAuthorBest answer
Senior II
July 9, 2021

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();
}