cancel
Showing results for 
Search instead for 
Did you mean: 

How to get started programming STM32

HNann
Associate

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.

2 REPLIES 2
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
AvaTar
Lead

> 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.