cancel
Showing results for 
Search instead for 
Did you mean: 

Flash hex file to stm32f412 with stlink using stm32cubeprogrammer

Vaishnavi
Associate II

Tried flashing stm32f412 custom controller using uart but facing error while going to boot mode.

Tried flashing using stlink, connected but failed to erase memory and application exiting automatically.

 

16 REPLIES 16
Imen.D
ST Employee

Hello @Vaishnavi and welcome to the Community,

Ensure that both the ST-Link firmware and STM32CubeProgrammer are updated to the latest versions.

Check the power supply to the board and check the jumper settings.

Try select the "Connect Under Reset" mode in STM32CubeProgrammer and erase the whole MCU.

Hope these steps and tips help you resolve your issue.

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

Hi @Imen.D 

Stlink and cubeprogrammer are using updated version only

Connected under reset only, its connecting but unable to erase whole mcu

What's going on with the VCAP pin(s) ?

Do you see 1.25v there?

Have you placed 4.7uF total capacitance on them? And not omitted or placed wrong values? 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hello,

As requested in this thread, please share your schematics.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello @SofLit 

I'm trying to flash my hex file to stm32f412 controller using stlink, but after connecting getting error 

15:01:09 : Erasing memory corresponding to segment 0:
15:01:09 : Erasing internal memory sector 0
15:01:09 : Error: failed to erase memory
15:01:09 : Error: failed to erase memory

Andrew Neil
Evangelist III

@Vaishnavi wrote:

Tried flashing stm32f412 custom controller using uart but facing error while going to boot mode.

:

I need to flash my hex file to custom stm32f412 board but unable to connect using uart and facing issue while erase memory


I thought the UART part was addressed in your other thread - marked as solved:

https://community.st.com/t5/stm32cubeprogrammer-mcus/flash-hex-file-to-stm32f412-with-uart-or-stlink-using/td-p/729115

 

So is this thread just about the ST-Link part?

 

As noted, you need to show your schematics:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

A good, clear photograph could also help

SofLit
ST Employee

Modified the post to focus on STLINK.

The system bootloader usage has been answered in this thred: https://community.st.com/t5/stm32cubeprogrammer-mcus/flash-hex-file-to-stm32f412-with-uart-using-stm32cubeprogrammer/td-p/729115

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello

I'm using stlink to flash my hex file to stm32f412, PA13-SWDIO and PA14-SWCLK

But unable to flash getting error, after connecting 

15:01:09 : Erasing memory corresponding to segment 0:
15:01:09 : Erasing internal memory sector 0
15:01:09 : Error: failed to erase memory
15:01:09 : Error: failed to erase memory

And application is closing automatically

@Vaishnavi 

Again, please share your schematics. The information you are sharing doesn't help.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.