AnsweredAssumed Answered

STM32F103CBT using code from Cube doesn't turn led on

Question asked by Zawyer on Jan 22, 2016
Latest reply on Jan 25, 2016 by wenjun.chen
Steps:
       
  1. Create new project on STM32CubeMx (v4.12.0)
  2.    
  3. Set PB3 as GPIO_Output
  4.    
  5. Generate code (for Atollic TrueStudio)
  6.    
  7. Import the generated files (project)
  8.    
  9. Use the following code to try blink the led
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 here (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

Attachments

Outcomes