Skip to main content
HNann
Visitor II
February 6, 2019
Question

How to get started programming STM32

  • February 6, 2019
  • 2 replies
  • 747 views

I'm attempting to program a blue pill stm32 but I'm plagued with software issues/errors and im in need of some advice/help. The issue is with the st-link v2 working in tandem with keil. It only works for the first time a try to flash the board and not any other attemps to flash the board.

other info:

I used STM32CubeMX to generate the code based on my specific MCU(STM32F103C8...) and built it in keil.

This topic has been closed for replies.

2 replies

ST Technical Moderator
February 6, 2019

Hello,

Try to upgrade the ST-Link firmware version to V2-1 through the STSW-LINK009, then disconnect and connect your board.

Otherwise, you can use the STM32CubeProgrammer software for programming STM32 products.

https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stm32cubeprog.html

Kind Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
AvaTar
Senior III
February 6, 2019

> It only works for the first time a try to flash the board and not any other attemps to flash the board.

Check that your example code does not use the JTAG pins as GPIOs, and that it does not employ any sleep mode.

Those use cases could make debugger access a bit finicky.

As last resort, you can use the Flash Loader Demonstrator software, and do a Flash mass erase after booting into system mode.