2025-07-07 8:58 AM
Hi @stm32
I have a STM32U5G9 chip connected to a NOR_FLASH Memory MX25UM51245G using OctoSPI. I created an External Loader for the setup, but unable to read/write using the stm32 programmer. The custom driver I developed for the particular flash is proved to work with the same hardware setup, so i can confirm that the bridging between the working driver and the STM2Programmer is somewhat missing.
Steps I Followed to create the Loader are:
1) Created a CubeMx project for stm32U5 with OctoSPI enabled in my case.
2) Manually copied the loader files from the link https://github.com/STMicroelectronics/stm32-external-loader/tree/contrib/Loader_Files and also integrated my custom driver for the particular NOR_FLASH. The driver is tested and verified separately,So it works.
3) In the build configurations, pasted the command cmd.exe /C copy /Y "${BuildArtifactFileBaseName}.elf" "..\${BuildArtifactFileBaseName}.stldr" to create stldr.
After further debugging, i came to the conclusion that the functions Init, Read,Write in the Loader_Src.c are not being called. I had similar problems for the STM32G0 but defining the RAM start address as 0x20000004 and aligning the Vector table to 0x20000000 | 0x200 resolved the issue. The similar fix doesnot help me here.
I would appreciate anyone's help in this if someone already know the problem and how to resolve it. Also, i couldnot see any documentation regarding how the 4bytes for STM32Cubeprogrammer BL to be assigned or how to align the vector table for a particular STM32 chip series.
I am also attaching my linker.ld, Dev_Inf.c/.h files, startup and the Loader_Src.c file for clearer picture. Please note that the Init ,Read and Write functions are properly loaded in the RAM by investigating the Build Analyser in the STM32CubeIDE. I am also attaching a screenshot of that.
Thanks,
Renjith Gopan