cancel
Showing results for 
Search instead for 
Did you mean: 

OpenOCD and RDP protection [STM32g0x]

Quentin_27
Associate II

Hi everyone 

I'm currently trying to set RDP option bytes on STM32G070 chip with OpenOCD 

I try :

> reset halt
[stm32g0x.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc

> stm32g0x lock 0
flash write algorithm aborted by target
flash write failed at address 0x1fff7808
flash memory write protected
SWD DPIDR 0x0bc11477
Failed to write memory at 0x4002200c
stm32x failed to lock device

 and :

> reset halt
[stm32g0x.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
> flash protect 0 0 last on
flash write algorithm aborted by target
flash write failed at address 0x1fff7808
flash memory write protected
SWD DPIDR 0x0bc11477
Failed to write memory at 0x4002200c
failed setting protection for blocks 0 to 63

I don't understand where the problem could come from because as you can see below I am able to erase and rewrite in flash without any problem...

Is anyone has already use that :

> reset halt
[stm32g0x.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
> flash erase_sector 0 0 last
erased sectors 0 through 63 on flash bank 0 in 0.025186s
> program "E:/OpenOCD/openocd-20240916/OpenOCD-20240916-0.12.0/bin/mon_firmware.hex" preverify verify
[stm32g0x.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0xf1000000 pc: 0xfffffffe msp: 0xfffffffc
**pre-verifying**
checksum mismatch - attempting binary compare
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
>

Thaks for your time 

Regards

0 REPLIES 0