2023-07-31 01:52 PM
Hello,
I followed the STMicro YouTube tutorial for developing an external QSPI loader. I am using the W25Q128 attached to the NUCLEO-H7A3ZI-Q. The flash is working fine with my driver using the test program "main_test.c" provided with the tutorial, and I can access the flash contents at 0x090000000 in memory-mapped mode from the STM32CubeIDE debugger. I compile the external loader with the linker script provided in the tutorial and move the .stldr file into the external loader folder for STMCubeProgrammer. I select my loader from the list of loaders, but when I try to view external flash contents at 0x090000000, I get data read failed. If I try to download data to the external flash from STMCubeProgrammer I get:
16:35:41 : Time elapsed during the read operation is: 00:00:00.009
16:35:50 : Memory Programming ...
16:35:50 : Opening and parsing file: testbinary1M.bin
16:35:50 : File : testbinary1M.bin
16:35:50 : Size : 1.13 MB
16:35:50 : Address : 0x09000000
16:35:50 : Erasing memory corresponding to segment 0:
16:35:50 : Download in Progress:
16:35:50 : Error: failed to download Segment[0]
16:35:50 : Error: failed to download the File
Is there a log file from STM32CubeProgrammer that would give me any details about the failure so I can debug this issue?
I attached my loader source which I adapted from the H7 loader file included with the tutorial.
Thanks,
Dan
Solved! Go to Solution.
2023-08-09 07:04 AM
I wanted to thank everyone for their help. It turned out to be a stupid mistake. I had the external flash address entered correctly in ST-Link Utility but was missing a zero in the address in STM32CubeProgrammer. Stupid mistake. It works fine with the correct address.
Dan
2023-07-31 11:45 PM - edited 2023-07-31 11:45 PM
I found the videos and files, I believe they are these:
How to create an external QSPI loader MOOC
Apparently it is necessary to modify the MX25L51245G driver to work with W25Q128 or any other model.
People who are still struggling with the driver of quadspi external loader, can find it here and rewrite their own driver.
Maybe there are examples with the W25Q128, I found this one, see if it helps:
https://github.com/bakhshipoor/STM32H7-W25Q128-External-Loader
2023-08-01 06:05 AM
Thanks for the information RhSilicon. I followed the example from bakhsipoor to create the external loader for my NUCLEO board. The strange thing is that my external loader works perfectly with the ST-LINK Utility program. I can read, erase, program, and verify external flash without errors, but I can only erase external flash with STM32CubeProgrammer using the same loader.
Is there some difference in the implementation of the external loader between the two programs?
Thanks,
Dan
2023-08-01 07:00 AM
Hello @DWWelch,
Could you specify the version of STM32CubeProgrammer ?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-08-01 09:50 AM
Hi F.Belaid,
I am using STM32CubeProgrammer V2.14.0.
Thanks,
Dan
2023-08-01 10:18 AM
>>Is there some difference in the implementation of the external loader between the two programs?
Two independently developed codebases, sequencing and usage have some nuanced differences. Would watch / observe function call sequences and parameters, and mask addresses to match those of the memory part, not the STM32. Also watch expectations for being in/out of memory mapped mode, and that regular commands don't work in memory mapped mode.
2023-08-02 09:44 AM
Hi Tesla,
Thanks for the advice. I made sure that all addresses were masked to my external flash size. The Init and Verify functions place the OSPI into memory-mapped mode. Write, SectorErase, and MassErase, disable memory-mapped mode using HAL_OSPI_DeInit followed by HAL_OSPI_Init. I also made sure that interrupts are disabled and preempted the HAL_InitTick, HAL_GetTick, and HAL_Delay with routines independent of SysTick.
STLink Utility still works fine and STM32CubeProgrammer can sector erase and full chip erase, but cannot read from external flash. It must not be entering or staying in memory-mapped mode in STM32CubeProgrammer?
Thanks,
Dan
2023-08-03 07:56 AM
I was wondering if there is a way to get a more detailed log file from STM32CubeProgrammer. Even at L3, I don't see any details about the external loader functions being called ( register preloads ) and the results or errors.
Trial and error is not getting results. ST-Link still works perfectly. CubeProgrammer can erase but not read. After launching STM32CubeProgrammer, the first thing that I try to do is view external flash, which fails. So I don't believe that Init() is being executed correctly in CubeProgrammer.
Thanks,
Dan
2023-08-09 07:04 AM
I wanted to thank everyone for their help. It turned out to be a stupid mistake. I had the external flash address entered correctly in ST-Link Utility but was missing a zero in the address in STM32CubeProgrammer. Stupid mistake. It works fine with the correct address.
Dan
2023-08-09 07:42 AM
I don't know if it can help, but I found these videos about advanced debugging: