cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H563 Custom External Loader Issues

lkantoski
Associate

I am trying to build a custom external loader for W25Q64 SPI. I am using the OCTOSPI1 using the follow pins.

PE11OCTOSPI1_NCS
PF6OCTOSPI1_IO3
PF7OCTOSPI1_IO2
PF8OCTOSPI1_IO0
PF9OCTOSPI1_IO1
PF10OCTOSPI1_CLK

I have followed the stm32-external-loader/Demo_Project as template. Currently I have no issue when making a example project using external loader function calls. I can read/write/erase without issue.

However, when the .stdr is used in STM32CubeProgrammer v2.17.0 GUI and command line it fails to do anything.

I get the following:

Reading data...
halt ap 1
w ap 1 reg 15 PC (0x20003000)
w ap 1 reg 17 MSP (0x20003500)
w ap 1 reg 16 xPSR (0x01000000)
Init flashloader...
halt ap 1
w ap 1 reg 0 R0 0x00000000
w ap 1 reg 1 R1 0x00000000
w ap 1 reg 2 R2 0x00000000
w ap 1 reg 3 R3 0x00000000
w ap 1 reg 4 R4 0x00000000
w ap 1 reg 5 R5 0x00000000
w ap 1 reg 6 R6 0x00000000
w ap 1 reg 7 R7 0x00000000
w ap 1 reg 8 R8 0x00000000
w ap 1 reg 9 R9 0x00000000
w ap 1 reg 10 R10 0x00000000
w ap 1 reg 11 R11 0x00000000
w ap 1 reg 12 R12 0x00000000
w ap 1 reg 13 SP 0x00000000
w ap 1 reg 14 LR 0x00000000
w ap 1 reg 15 PC 0x20003521
w ap 1 reg 16 xPSR 0x01000000
w ap 1 reg 17 MSP 0x00000000
w ap 1 reg 18 PSP 0x00000000
run ap 1
halt ap 1
r ap 1 reg 0 R0 0x00000000
Init function fail
r ap 1 reg 16 xPSR 0x01000003
halt ap 1
w ap 1 reg 15 PC (0x20003000)
w ap 1 reg 17 MSP (0x20003500)
w ap 1 reg 16 xPSR (0x01000000)
Error: failed to read the requested memory content

I believe this issue is something with LR and MSP registers not being assigned. However, I am not sure how to go about doing that. I have tried to added debug with LEDs, however it never enters the Init function. The PC appears to point to the Init function

Note: I only have access to STM32CubeIDE.

 

1 REPLY 1

It's claiming it called Init() and you returned zero (fail code)

There's no static initialization occurring, so no startup.s, SystemInit() or main() being called. There shouldn't be a vector table, and you shouldn't be using interrupts.

You can perhaps use a UART to communicate, or a GPIO / LED in some form or fashion

The build basis for RAM should be 0x20003004, and not 0x20000004 (most) or 0x24000004 (H7)

RAM_PROG (xrw) : ORIGIN = 0x20003004, LENGTH = 256K-12292

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..