External memory Loader:Introduction to External memory Loader

Revision as of 11:52, 22 May 2024 by Registered User
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

1. External Memory Loader

1.1. What is a loader ?

A "loader" is a set of functions grouped together in a binary that are individually called by a tool to perform actions on dedicated memory. The loader is loaded by the tools inside a RAM space and its execution is managed by the tool, the loader specifity are :

  • binary  : loader is a binary using a continuos RAM area to store code and data.
  • loader file  : the loader file is an ELF file (contains symbol information)
  • interrupt : they are disabled this is a recommandation for the tool to keep control over the execution flow.
  • Stack Pointer  : the loader doesn't allocate memory space to the stack.
  • RAM Buffer  : there is no space allocated to store the data to be written.
  • Map mode  : this is the preferred mode for checking written data.

1.2. Architecture of External Memory Loader

The External Memory Loader is a middleware for STM32 that consists of a core component and target entry points for the loader.
The core contains two components:

  • memory_wrapper : an abstraction layer poviding basic memory services based on the usage of the middleware external memory manager.
  • Systick management : a Systick management wrapper to make systick managament functionnal without interrupt, the main reason for this module is to keep functionnal HAL management of timing.

loader2.png

1.3. Loader Mechanism in IDEs

To run a loader, you need three essential components: a tool such as an IDE (IAR, KEIL, CubeIDE) or a loader program (CubeProgrammer), a binary format loader containing code and symbol information, and an STM32 board with embedded external Flash memory.

The loader tool operates in the following steps:

  • Read the loader file to retrieve function and memory information.
  • Load the code into the internal RAM of the STM32.
  • Allocate space in RAM for RAM buffer and Stack.
  • Use loader functions to load firmware into external memory.

Lmec.png Main loader operations

The main loader operations are :

  • Initialize the external memory.
  • Erase memory by sector or by masserase.
  • Write buffer into external memory.
  • Verify external memory downloaded content.


1.3.1. EWARM (IAR IDE)

IAR loader configuration file:

  • flash memory configuration file (.flash) : is an XML file that describe the memory elements to the debugger These include, for example, the flash memory base address, the flash loader name, and flash memory characteristics, such as block and page size. The file also specifies which flash loader to use.

flash.png

  • flash memory system configuration file (.board) : is an XML file that specifies the information needed to perform flash loading for a specific board. You can prepare this file in advance for various development boards, and create or modify the file in the IAR Embedded Workbench IDE.

board1.png

1.3.2. STM32CUBE

STM32CUBE loader configuration file  ::

No configuration needed, the ExtMemLoader will be copied automatically under STM32CubeProgrammer using post build.

cube.png

Info white.png Information
Using STM32Cubeprogrammer, it is possible to create a loader for it through three different Integrated Development Environments (IDEs). It is important to note that for each IDE, the corresponding IDE should be used.

1.3.3. MDK-ARM (keil IDE)

MDK-ARM loader configuration file ::

The generated *.FLM file needs to be added to the Pack with Device Support, so that it is available to the tool user for programming his device. Usually, a directory Flash is created and the algorithm is saved in this directory. The algorithm is specified within the the /package/devices/family level:
keil1.png

  • The argument start specifies the base address for the Flash programming algorithm.
  • The argument size specifies the size covered by the Flash programming algorithm. End address = start + size - 1.
  • The argument default specifies whether a Flash programming algorithm is set as the default algorithm in a project (when true).


No categories assignedEdit