you should not have any issue if TrustZone is enabled and RDP is level 0.

**but if the RDP is Level 0.5**
the trick here is that the loader needs a place in the RAM to run, but since 
the system is secure and the RAM as well, we need either to specify the 
non-secure RAM as workarea (unknown to the debugger and the user has to provide 
it)
or just disable the loader and do the programming without the loader.

I would recoment the easy way, so I instrumented the flash driver with a new 
command: 
`stm32l4x flashloader <num> [enable | disable]`

`<num>` is flash bank number as shown by the command 'flash banks', in simple 
usecase, this should be equal to 0

you can add it to you configuration file, please let me know if this works for 
you.

I will try to provide an intelligent way to enable disable the flashloader 
depending in the situtation in next week.


---

** [tickets:#319] stm32l5 flashing issue**

**Status:** new
**Milestone:** 0.11.0
**Labels:** stm32lx flash 
**Created:** Fri Sep 10, 2021 06:53 PM UTC by Yestin Sun
**Last Updated:** Fri Sep 10, 2021 07:47 PM UTC
**Owner:** nobody
**Attachments:**

- 
[openocd_flash_stm32l5_failed_log.txt](https://sourceforge.net/p/openocd/tickets/319/attachment/openocd_flash_stm32l5_failed_log.txt)
 (612.7 kB; text/plain)


I am compiling the openocd from the master branch to try out the flashing on 
NUCLEO-L552ZE-Q board in secure mode, but find out that there seems to be some 
regression when flashing in non-secure mode which was working.

Here is the error I am getting.

Info : device idcode = 0x20016472 (STM32L55/L56xx - Rev 'unknown' : 0x2001)
Info : TZEN = 0 : TrustZone disabled by option bytes
Info : RDP level 0 (0xAA)
Info : flash size = 512kbytes
Info : flash mode : dual-bank
Info : Padding image section 0 at 0x0800402c with 4 bytes (bank write end 
alignment)
Warn : Adding extra erase range, 0x08004030 .. 0x080047ff
Error: timeout waiting for algorithm, a target reset is recommended
Error: error executing stm32l4 flash write algorithm
Error: flash write failed = 00000088
Error: block write failed
Error: error writing to flash at address 0x08000000 at offset 0x00000000
auto erase enabled

After some digging, this starts to happen after the switch to C load from the 
assembly loader.
https://review.openocd.org/c/openocd/+/6109

Please also find the debug error log in the attachment.

Thanks!


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to