cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS: xSemaphoreGiveFromISR() not functional from ISR in STM32F746G-DISCO board

S.Kamath
Associate II

Hi, I see that xSemaphoreGiveFromISR() not functional from ISR in STM32F746G-DISCO board

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:

1. Target board & CPU: STM32F746G-DISCO, STM32F746NG

2. FreeRTOS project is created from STM32CubeMx

3. Used TIM3  for Timebase Source and TIM2 for 1sec interrupt generation using internal clock

4. Refer below section for definition of configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY

References:

**main()**

void Thread2(void const * argument)

{

 uint8_t txData[20] = "Hello from Thread2\r\n";

 while(1)

 {

  if(xSemaphoreTake(myBinarySem01Handle, portMAX_DELAY)) {

   HAL_GPIO_TogglePin(GPIOI,GPIO_PIN_1);

   HAL_UART_Transmit(&huart1, txData, 20, 5);

   osDelay(100);

  }

 }

}

**Timer Interrupt Callback**

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 */

   

  xSemaphoreGiveFromISR(myBinarySem01Handle,NULL);

 }

}

define NVIC_PRIO_BITS         4

define configPRIO_BITS        4

define configLIBRARY_LOWEST_INTERRUPT_PRIORITY       15

define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY     5

define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )

define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )

0 REPLIES 0