2016-01-21 06:27 PM
Steps:
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3,GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3,GPIO_PIN_RESET);
HAL_Delay(500);
6. Compile and upload
Result: nothing happens, led stays off.
Note: I'm testing on a custom made board with an STM32F103CBT, and a led correctly connected to PB3. USART works correctly if I add it so chip is ok.
I also tested with init code from
(none Cube generated) and the led blinks successfully, so the problem lies in Cube generated init code or I'm missing something?
Attached a zip with the files (generated by Cube) and my 4 lines added
#stm32f103-gpio-cube
2016-01-21 07:39 PM
Can you use a debugger, and step through the code? Examine the peripheral settings, clocks, registers, etc.
2016-01-23 01:05 PM
Debugger is on its way (shipping)
But found the problem, Debug functions conflicts with PB3 and PB4, and even tho you select those as OUTPUT GPIOs, Cube doesn't disable debugging. It warns you about the conflict (exclamation sign next to SYS) but the dropdown menu next to ''Debug'' auto-selects ''Disabled'' making you think its taken care of You have to select ''No Debug'' to actually disable it2016-01-24 12:58 AM
2016-01-24 10:09 AM
Agree.
Just wish it was a little more explicit2016-01-25 04:05 AM