0

Anyone help me I have .elf and .hex files. I need to load .elf or hex to qspi flash memory location..

What is the design I need to follow.

I tried the below steps

  1. extracted .elf file to .bin file.
  2. by using jlink script I can able to load .bin file. but I did not able to open .bin file in jlink script.

Is there any way to load .elf file to flash?

I expected through jlink i need to load .elf file to qspi flash memory

Frant
  • 5,382
  • 1
  • 16
  • 22

1 Answers1

0

You need the correct flash driver file to do this.

A flash driver file is a special ELF file which is loaded to the RAM of the microcontroller and executed there.

The J-Link debugger writes the data to the RAM and the flash driver file then writes this data to the QSPI flash.

In the file JLinkDevices.xml you'll find a list of already existing flash driver files. Example:

<Device>
    <ChipInfo Vendor="O2Micro" Name="OZ93510F160LN" ... />
    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x60000000" MaxSize="0x00020000" Loader="Devices/O2Micro/O2Micro_OZ93510F160LN_QSPI.elf" ... />
</Device>

This means:

  • Name="OZ93510F160LN":
    The flash driver is valid for this microcontroller.
  • MaxSize="0x00020000":
    The size of the QSPI flash
  • Loader="Devices/O2Micro/O2Micro_OZ93510F160LN_QSPI.elf":
    The flash driver file
  • BaseAddr="0x60000000":
    The QSPI flash corresponds to addresses 0x60000000 to 0x6001FFFF in the ELF file
    This means that you have to compile your ELF file in a way that the data to be written to the QSPI flash is located at address 0x60000000 in the ELF file when using this flash driver.

Unfortunately, some QSPI flash memories require different commands than others. In this case, it might be necessary to write your own flash driver when your QSPI flash uses different commands than supported by the already existing flash driver.

Martin Rosenau
  • 17,897
  • 3
  • 19
  • 38