Hi,
I see that xSemaphoreGiveFromISR() not functional from ISR with STM32F746NG.
HAL_GPIO_TogglePin is working fine when it is called in ISR. But, xSemaphoreGiveFromISR is not working.
Is there any STM32F746NG configuration is missing to make it work with STM32F746NG?
NOTE:
Target board & CPU: STM32F746G-DISCO, STM32F746NG
FreeRTOS project is created from STM32CubeMx
Used TIM3 for Timebase Source and TIM2 for 1sec interrupt generation using internal clock
Refer below section for definition of configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef htim)
{
if (htim->Instance == TIM3) {
HAL_IncTick(); //TIM3 used for Timebase Source
}
else if(htim->Instance == TIM2) {
/ HAL_GPIO_TogglePin(GPIOI,GPIO_PIN_1);
LED blink working fine when below SemaphoreGiveFromISR commented */
Please cut down your project to the very minimum that demonstrates this
problem (remove everything other than the code in question), zip it up,
then attached the zip file to a post in this forum.
There is a lot more in this project that just the part that is causing
the issue. Can you give me a clue where to look.
In the mean time, what does this line do?
osSemaphoreDef(myBinarySem01);
Looks like it might declare a semaphore on the stack of main(), which
won’t exist when the scheduler starts, but I’m not familiar with this
API. Could be the issue though.
Put a break point on the call to xSemaphoreGiveFromISR() inside
HAL_TIM_PeriodElapsedCallback().
If the breakpoint isn’t hit, then that is the problem, otherwise if
the breakpoint is hit inspect the variable myBinarySem01Handle in the
debugger. It should be a pointer to a structure, but you might have to
cast it to a xQUEUE* to see the structure members (so you would add
“((xQUEUE*) myBinarySem01Handle” to the debugger’s watch window). Take
a screen shot of the debugger so we can see the values inside the
structure and post the screen shot here.
Step into the xSemaphoreGiveFromISR() function line by line in the
debugger, and see what path it takes through the function.