2021-05-24 01:51 AM
Hello, I am trying to create external loader for MX25L12835F flash memory. My MCU is STM32H7B0RBTx and I followed "External QSPI loader how to" video series on Youtube. I used source files from the Github link that is shared below the videos. I had to change content of functions in quadspi.c file because STM32H7B0RBTx has OCTOSPI and contents of libraries are different. But I didn't change name of functions.
When I try this test code it can reach end of the code without any error so I can read memory in the debug screen.
After finishing test I include Dev_Inf.c, Dev_Inf.h, Loader_Src.c and linker.ld files. I used linker.ld for H7 devices to be sure that RAM start address is 0x24000000. In the Loader_Src.c file I only made these changes:
I compiled code and created .stldr file and prepare it for STM32CubeProgrammer.
When I try to read data STM32CubeProgrammer it says Data read successfully but it isn't showing correct data.
When I try to upload test binary file with these settings
I get this error.
Also in the test code it can delete sectors 0-2047, it cant delete 2048 and stuck in while loop. Device size is 16 MB and sector size is 4 KB so there must be 4096 sectors.
What am I doing wrong and how can I solve it? Thank you.
Solved! Go to Solution.
2021-05-24 04:38 PM
Hello. I think HAL_OSPI_Abort(&hospi1) in Loader_Src.c cause the error. In fact, I have experienced the same problem as you.
To check quickly, how about commenting out HAL_OSPI_Abort(&hospi1) in Loader_Src.c? If it is not the solution, your problem is not the same as mine (Sorry...).
2021-05-24 04:38 PM
Hello. I think HAL_OSPI_Abort(&hospi1) in Loader_Src.c cause the error. In fact, I have experienced the same problem as you.
To check quickly, how about commenting out HAL_OSPI_Abort(&hospi1) in Loader_Src.c? If it is not the solution, your problem is not the same as mine (Sorry...).
2021-05-24 11:35 PM
I just tried but it didn't work unfortunately.
2021-06-16 02:59 AM
Last time I commented out but I didn't write there anything. I must init and deinit OSPI instead of calling HAL_OSPI_Abort. Below the video there are two GitHub links and both has codes for H7 devices. I thought Loader_Src.c files are same because same person wrote both of those and I used first one and it didn't work well because of HAL_OSPI_Abort, second file doesn't have HAL_OSPI_Abort.
Also I could reach only half of memory because I made wrong device size settings. Device size 2^24 so I made device size setting 23 because it was 2^(n+1) with older HAL libraries but now they changed it and it must be 2^(n) so that n or setting must be 24.
Here is the source files for MX25L12835F with OSPI configuration.
2021-06-16 03:00 AM
2021-06-16 03:01 AM
2021-06-16 03:01 AM
2021-06-16 03:01 AM
2021-06-16 03:11 PM
Thank you for updating information!!
2021-06-16 03:17 PM
>>I can only add 1 file
Make it a .ZIP, or start a thread, you can only attach singular files to subposts.