The custom made external loader, failed to make multiple Reads, (STM32CubeProgrammer returns error)
- May 4, 2023
- 6 replies
- 7891 views
I follow the guide to make an external loader and it works for the most part. I can erase sectors, write data. But I can only read data once. If I try make multiple Read, STM32CubeProgrammer returns error. See example below:
Example:
14:56:32 : Time elapsed during the read operation is: 00:00:00.007
14:56:35 : UPLOADING ...
14:56:35 : Size : 1024 Bytes
14:56:35 : Address : 0x90000000
14:56:35 : Read progress:
14:56:37 : Data read successfully
14:56:37 : Time elapsed during the read operation is: 00:00:02.314
15:18:18 : UPLOADING ...
15:18:18 : Size : 1024 Bytes
15:18:18 : Address : 0x90010000
15:18:18 : Read progress:
15:18:26 : Error: Data read failed
It does not matter, which start address I use in the second read request. If I use Address: 0x90000000, in the second read I receive same error.
I have tested the code in "non-extern-loader-mode", by change the linker file from linker.ld to STM32F767IITX_FLASH.ld.
The code in the main() is then executed. I am then able to enable memory mapped mode and make several read from different segments in the external flash.
Example:
Erase 16MB external flash
Write 16MB test data into external flash
Enable Memory Mapped Mode
Read data in memory mapped mode
0x90000000: 0x0
0x90000004: 0x1
0x90000008: 0x2
0x9000000c: 0x3
Read data from next 64kB Section
0x90010000: 0x3fff
0x90010004: 0x3ffe
0x90010008: 0x3ffd
0x9001000c: 0x3ffc
When I execute code in "non-extern-loader-mode"
I am then able to use ST-Link and STM32CubeIde memory browser and view several memory sectors without any problem, so the driver seems to work as it should.
The file: Loader_Src.c
In the end of the function Init(), I invoke BSP_QSPI_EnableMemoryMappedMode(). This function is also invoked in the beginning of the function Verify().
What could be the problem in "external loader mode"? Read operation is managed directly by CubeProgrammer. Any Idea?
Thanks in advance!
Other information
Hardware
Flash = MT25QL128ABA
Processor: STM32F767IIT6
The customer board uses an external 12 MHz crystal, and this loader is configured to use this external crystal.
Development tools
STM32CubeIDE, Version: 1.12.0, Build: 14980_20230301_1550 (UTC)
STM32CubeProgrammer V2.13.0
More info
Datasheet MT25QL128ABA
External Loader demo project (Used as reference)
