2025-02-13 07:12 PM - last edited on 2025-02-14 04:45 AM by Andrew Neil
I am new to FreeRTOS ( RTOS in general, although I am very familiar with baremetal) and am following along with this video:https://www.youtube.com/watch?v=CdpgqpuPSyQ&t=4s
I am using a STM32F3DISCOVERY board so I had to make some minor tweaks to follow along, seemingly just pin numbering. I am using the default pin configurations and clock configuration. I am using TIM6 as Timebase source. I cannot seem to figure out why my LEDs are not blinking. I created a baremetal project to confirm the config of the pins is good and there I can get them toggling. I see the TIM6 CNT incrementing and wrapping so that is working. I tried to use breakpoints to see if I ever get back to my task and aside from the first hit during initialization, I never get back.
Not sure what I did wrong, but it appears my tasks only occur once and then terminate but I cannot figure out why. Any tips on how to debug this? Thank you
2025-02-13 09:07 PM
> I am using TIM6 as Timebase
in main.c, there is no reference to TIM6, but TIM4.
hth
KnarfB
2025-02-13 09:13 PM
I used TIM6 originally like the demo but after some debugging effort I played around with trying others, meant to change it back to TIM6 before uploading that is my mistake. I do not believe it is the issue however
2025-02-13 10:26 PM
> I do not believe
seeing is believing.
Set a breakpoint at the timer callback and check that it is called. The interrupt handler is in the *_it.c file. Check that everything is consistent.
hth
KnarfB
2025-02-14 02:10 AM - edited 2025-02-14 02:28 AM
+
Did you set a break points in tasks infinite loops:
for(;;)
{
HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_11); // on board green LED
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_4); // external LED
osDelay(500);
}
and
for(;;)
{
HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_11); // on board green LED
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_5); // external LED
osDelay(600);
}
Also, do you reach the call of osKernelStart() when you set a break point to it?
2025-02-14 04:40 AM
I meant more that I don't think TIM4 vs TIM6 was the issue, just a discrepancy between file and description, very well may be a timer issue.
I do hit the callback in that *_.it.c file, but it stops after the LEDS on GPIOs 5 and 4 turn on which is done in the 2 tasks
2025-02-14 04:41 AM
I do reach osKernalStart(). I also put breakpoints in the 2 task loops and hit each breakpoint once at startup then never again
2025-02-14 04:53 AM
@andrewralea wrote:
I do reach osKernalStart(). I also put breakpoints in the 2 task loops and hit each breakpoint once at startup then never again
That's weird .. Unfortunately, I don't have F3 dico board at the moment. If you will not solve the issue by next Monday, I will try to find a board and run the test.
2025-02-14 05:23 AM
Okay I will let you know if I figure anything out before then, thank you!
2025-02-14 06:01 AM
while debugging, you might want to use