Skip to main content
Associate II
October 9, 2024
Question

Flash hex file to stm32f412 with stlink using stm32cubeprogrammer

  • October 9, 2024
  • 4 replies
  • 5594 views

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.

 

4 replies

Technical Moderator
October 9, 2024

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"".ThanksImen"
VaishnaviAuthor
Associate II
October 9, 2024

Hi @Imen.D 

Stlink and cubeprogrammer are using updated version only

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

mƎALLEm
Technical Moderator
October 9, 2024

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."
Tesla DeLorean
Guru
October 9, 2024

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User
October 9, 2024

@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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
Technical Moderator
October 9, 2024

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."
VaishnaviAuthor
Associate II
October 10, 2024

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

mƎALLEm
Technical Moderator
October 10, 2024

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