cancel
Showing results for 
Search instead for 
Did you mean: 

Read external SPI Flash with external flashloader and CLI is slow.

Marco.R
Senior

Hello

I implemented an external flashloader for STM32F767 for an external SPI Flash. The size of the flash is 256MBit. I want to readout the whole flash with *.bat file. I tried with this line:

STM32_Programmer_CLI.exe -c port=SWD reset=HWrst freq=8000 -el "PathToFlashloader.stldr" -r 0x90000000 500000 "readfile.bin"

I works properly but only until a size of about 500KBytes (Is this limited by the ST-Link v3 or the STM32CubeProgrammer CLI?)

What I do now, is executing the same line of code (see above) with with different addresses. In the end I get whole memory, but in different files and it tooks a lot of time, because the reconnect of the device tooks a lot of time.

  • Is there a possibility to get the whole memory in one file?
  • Is there a possibility to add several readouts to one instance like this?:
STM32_Programmer_CLI.exe -c port=SWD reset=HWrst freq=8000 -el "PathToFlashloader.stldr" -r 0x90000000 500000 "readfile.bin" -r 0x9007A120 500000 "readfile2.bin"

I tried this, but it doesn't work properly.

Are there any other hints for optimizing the script? Primarly I need to read the memory. Writing and erasing is not important.

Thanks

\Marco

10 REPLIES 10

The observed delays between blocks suggests the implementation is ping-pong style: One block is read from flash, and only when this is completed, the block is transferred to the host. That's no good.

A more efficient implementation is via a circular buffer, the flash's data is read by the *target* into the buffer, and host reads data concurrently from this buffer via debug interface. That both debug interface and target use the same internal bus doesn't give a significant penalty here, as both QSPI interface and debug interface are rather slow in comparison.

Another option would be to use two or more buffers alternatingly, but the optimal number depends on several factors and is difficult to predict.