- This topic has 1 reply, 2 voices, and was last updated 7 years, 8 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › Can't get LED to blink from template
I’m following the book but I’m using the discovery board F0 instead.
I am using eclipse like the book, made a project by selecting the correct MCU and ram and loaded the blink template. The blink template looks like it should work right out of the box, I can see the code is suppose to blink PC9 which LED3 but when I built the project and loaded it to my board, I don’t see the LED blinking.
I went to youtube and copied someone’s code that directly assigned values to RCC and GPIOC. His code worked and I got the LED to blink. So my board isn’t broken but I can’t get the template to work.
I don’t know what I’m doing wrong when I try to build the blink template directly. If I can’t get the template to work, is this going to affect how I follow the later chapters?
One really frequent mistake is the lack of clock enabling macro for that GPIO port:
__HAL_RCC_GPIOC_CLK_ENABLE();