2025-11-12 2:50 AM - last edited on 2025-11-12 3:01 AM by Andrew Neil
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code.
i am trying to interface stm32f411ceu6 with sdcard using spi ,and i have successfully interfaced it but when i try to run this code using freertos by using another timer as timebase source it not works
below code is in interrupt .c file . i wanted to use freertos just to make task but i dont know why my code not works when i enable freertos from stmcubemx
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
if(Timer1 > 0)
Timer1--;
if(Timer2 > 0)
Timer2--;
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
2025-11-12 3:08 AM
Welcome to the forum.
Please see How to write your question to maximize your chances to find a solution for best results.
In particular, please give details of your hardware, your tools, etc.
@Shubham-8080 wrote:below code is in interrupt .c file . i wanted to use freertos just to make task but i dont know why my code not works when i enable freertos from stmcubemx
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
if(Timer1 > 0)
Timer1--;
if(Timer2 > 0)
Timer2--;
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}So what, exactly, does "not working" mean?
You haven't shown your definitions of the two timer variables. They are being updated in an interrupt handler, so are they volatile ?