STM32L4: Debug is NOT possible when PCROP is activated
Dear ST support,
I have to allocate my code after a flash memory section holding a third party IP which is protected by the PCROP. Obviously my linkerscript does NOT allocate anything at the protected location so this should work fine.
Doing this, OpenOCD stops the debugging session because it was NOT able to erase all sectors prior to load the binary code to flash.
Does OpenOCD provides an option to ignore erase error ? Can I tell OpenOCD not to access some flash memory sectors ? Any other solution ?
Here is the OpenOCD console log:
Open On-Chip Debugger 0.10.0-dev-00278-ga53935e-dirty (2017-05-09-09:25)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
padded zone erase set to 1
adapter_nsrst_delay: 100
adapter speed: 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v25 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.897312
Info : STM32L476.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002ef0 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
Info : Device id = 0x10076415
Info : STM32L4xx flash size is 1024kb, base address is 0x8000000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002ef0 msp: 0x20018000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002ef0 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
Info : wait_status_busy, WRPERR : error : remote address 0x40022000
Error: erase time-out error sector 100
Error: failed erasing sectors 96 to 163
Error: flash_erase returned -4
Info : dropped ‘gdb’ connection
Many thanks for reading this and maybe have a solution,
Best regards,
Sylvain