Using FLM file in MDK (Keil Uvision) to flash external SPI FLASH via JLink

93 views Asked by At

Target and toolchain context

So i use an exotic Cortex M4 device with NPU (2 core m4, 1 core NPU). This SoC has a small internal flash and SRAM, and an external 16MB SPI FLASH and 8 MB SDRAM. The firmware is essentially either flashed on SPI FLASH for production, or SDRAM for development. internal FLASH is only used for BOOT1 essentially.

The issue

I try to flash the firmware to external SPI FLASH from MDK.

What has been tried

So the toolchain includes an MDK template already set with the FLM file for SDRAM operations, i use this template for the development / debug. A standalone tool to flash the SPI FLASH partitions is also provided, be it for boot1, firmware or the other data partitions. This tool is fine for production, but not convenient during development. I also have an FLM file for the external SPI FLASH, this file contains the flash algorithm that is needed by MDK to flash the SPI FLASH, unfortunetely, no MDK template is provided to use it, so i am unsure of the exact configuration of the MDK project to acheive flashing firmware to external SPI FLASH.

Here is the memory map of this SoC

flash address space code run from flash (0x10000000)
data run from sram (0x20000000)

sdram address space code run from sdram (0xC0000000+ReserveSize(64K))
data run from sdram (code address + codeImageSize)

sram address space code run from sram (0x20000000)
data run from sram (code address + codeImageSize)

and here is the project options for the current configuration with SDRAM.

MDK option/target

MDK target/Debug

MDK Jlink Flash Download

I added a new configuration for EXT_FLASH

MDK Jlink Flash Download

Here are the fields i am not sure about

MDK Jlink Flash Download

MDK options/target

Does anyone know what is wrong in my setup?

0

There are 0 answers