Skip to main content
Harwinder Singh
Associate III
July 15, 2020
Question

How to know which data in hex files is for internal Flash & which is for External QSPI Flash?

  • July 15, 2020
  • 6 replies
  • 2139 views

Hello Everyone,

I am working on a project in which we load hex or bin file in USB pendrive and stm32F7 will read this file over USB_FS using Fatfs. Then it will program it self using same hex file(IAP from USB pendrive ). if i am using only internal flash every thing is fine no doubt about hex or bin file, But if i will also use external qspi flash then IDE like cube ide or Keil are generating single hex or bin file for both Memory. Now my question is that how to identifies that which data in file is for internal flash and which one is for external one?

Thanks

This topic has been closed for replies.

6 replies

hs2
Visitor II
July 15, 2020

You need to decode the hex records properly. A hex file might contain (load) addresses of multiple memory regions besides the program start address.

Tesla DeLorean
Guru
July 15, 2020

The format is not unduly complicated and is processed linearly, a line at a time.

The combination of segment and data lines should decode into an address, the range of address dictating which device the data should go. Addresses in the 0x90000000 range being external QSPI.​

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Andreas Bolsch
Lead III
July 15, 2020

By address, the QSPI memory space starts at 0x90000000. That's fixed in hardware.

Harwinder Singh
Associate III
July 16, 2020

ok Thanks for your answers. Any idea about bin file because mcu is taking time to decode hex file. So if it is possible with bin file it will take less time.

Thanks

Andreas Bolsch
Lead III
July 16, 2020

A binary file would be a rather bad idea. As there is no address information (except maybe for start address) a bin file would span the gap between the internal flash and the QSPI address range ... You'll get hundreds of MBytes then. Not really nice.

hs2
Visitor II
July 16, 2020

In comparison to the time needed to flash/write the data decoding is negligible. The bigger drawback might be the amount of data to transfer due to the ASCII encoding..

Harwinder Singh
Associate III
July 16, 2020

Agree with all points. Thanks all for your answers. Further i will go with hex file and let you know the results.

Thanks.