2024-08-05 12:58 PM
I am trying to build a custom external loader for W25Q64 SPI. I am using the OCTOSPI1 using the follow pins.
PE11 | OCTOSPI1_NCS |
PF6 | OCTOSPI1_IO3 |
PF7 | OCTOSPI1_IO2 |
PF8 | OCTOSPI1_IO0 |
PF9 | OCTOSPI1_IO1 |
PF10 | OCTOSPI1_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.
2024-08-05 01:38 PM
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
2024-08-05 05:11 PM
https://github.com/cturvey/stm32extldr/tree/main/h5_w25q64