2021-07-09 01:08 AM
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
Solved! Go to Solution.
2021-07-09 02:43 AM
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();
}
2021-07-09 01:37 AM
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
2021-07-09 02:09 AM
Hi,
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.
2021-07-09 02:30 AM
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
2021-07-09 02:34 AM
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...
2021-07-09 02:43 AM
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();
}
2021-07-09 04:18 AM
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 :thumbs_up:
/Romain
2021-07-11 09:40 PM
I'm using Keil RTX and I'm calling osThreadYield(); But the Keil "version" does not allow calling from ISR.
Perfect.
/jimmii
2021-07-12 04:31 AM
Could you share what bit depth you have ? and what mcu ?
/Romain
2021-07-12 04:40 AM
/jimmii