![]() ![]() This record indicates the start address of the application. 080002B9 – is the 4-byte linear start address of the application.05 – is the record type 05 (a start linear address record).The penultimate line of the file is a Start Linear Address record: :04000005080002B934 elf file using the command: $ arm-none-eabi-objdump -d -S. The mixed assembler-hex output can be generated from the. This address is a C function called start. Combining with the next data record: :10 0190 00 DB ![]() The next half-word is 0xf000 which, as it starts with 0xf is a 32-bit Thumb-2 opcode. This maps onto the 16-bit Thumb-2 instruction, e.g. The 16-bit value at the address 0x0800018C is 0xB508. The actual record contents are: :100180008901000889010008FEE7FFFF08B500F0BBīreaking this down into 16-bit values (the smallest opcode size for thumb-2), we get the following record contents: :10 0180 00 BB If we move further down the hex file to the record beginning :10018000, it contains the bytes destined to be loaded between 0x08000180 and 0x08000190. The earlier records indicated that the Reset_Handler is located at the address 0x0800018c. We can deduce the address offset as 0010, giving a load address of 0x08000010. map file the IVT entries become apparent: 20020000 - _stack = (ORIGIN (RAM) + LENGTH (RAM)) These four words, therefore, give a series of 32-bit addresses: Īs the values are stored as little-endian, the 4-byte groups can be viewed as the following table entries: 20020000Īs the Cortex-M4 is programmed using the Thumb-2 ISA, all function addresses have a +1 offset (to indicate Thumb-2 mode). The data bytesĪs this is a record for the STM32, the first record is likely to be the Interrupt Vector Table. The address for this record is calculated by bit-oring the address with the address from the extended linear address record, e.g. We can break this down into a series of fields: : 10 0000 00 FC Our next record is a data record containing the raw byte values to be stored in program memory. The first data line is: :10000000000002208D0100089301000897010008FC The checksum is simply calculated by an 8-bit sum of the record bytes and then complimenting the sum to generate the checksum, e.g.: (uint8_t)(~(0x02 + 0x00 + 0x00 + 0x04 + 0x08 + 0x00)+1)įor a very large image, it is possible to have multiple ELARs, but this is less likely on a smaller microcontroller image. ![]() All other records defined in the hex file are defined relative to this address. So we can see the upper 16-bit of this address being 0x0800, thus, a starting address of 0x08000000. The Flash start address is defined in the linker script as: FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K This particular file is built to run on an STMicro ST32F407VG Cortex-M4 microcontroller.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |