Skip to main content
Associate
July 18, 2023
Solved

Can't re-program STM32G030C8

  • July 18, 2023
  • 6 replies
  • 3252 views

I have tried everything I can think of to get part to program, I still get this:

The elf loader Sector Erase function fails.
Memory-Loader error
Error occured during erase operation!
Programming error @ 0x08000000!

I have tried STL CLI, JFlash-lite, JFlash, STM32Cubeprogrammer, always the same thng.

If anyone has any ideas I would be grateful.

This topic has been closed for replies.
Best answer by mark4444az

Found this:

  1. Make PCROP_RDP checked, enable RDP level 1
  2. Program option bytes.
  3. Disable RDP.
  4. MCU should be erased to 0xFFFFFFFF

That actually worked!  Found it on another thread. 

6 replies

RomainR.
ST Employee
July 19, 2023

Hello @mark4444az 

Is it a custom board? If yes do you have checked SWD connection?

If you are able to etablish a SWD connection with STM32CubeProgrammer, check option byte if the device is not protected (RDP ?)

BR

Romain

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.
Associate
July 19, 2023

I am using an STLink-V3Minie. I can look at the Option Bytes:

 

 

mark4444az_1-1689775041465.png

The Read/Write Protection is not checked so it is not on. Further, I have tried the JLinkSTM32 executable to reset options back to factory settings, said that  worked.

I do not see 

Associate
July 19, 2023

I still am having no luck on programming.

AScha.3
Super User
July 19, 2023

did you try loading a bin or hex file ?

+ another chip ? maybe this one has a "problem" .

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate
July 19, 2023

Yes, replaced the processor and programmed with gui and it's ok. The issue appears to be in my script file:

ST-LINK_CLI.exe -c SN=002000283431511737393330 -p RAD3.hex 0x08000000 -v -rst

When I use that it seems to brick the uP.

mark4444azAuthorBest answer
Associate
July 19, 2023

Found this:

  1. Make PCROP_RDP checked, enable RDP level 1
  2. Program option bytes.
  3. Disable RDP.
  4. MCU should be erased to 0xFFFFFFFF

That actually worked!  Found it on another thread.