User Tools

Site Tools


This is an old revision of the document!

ARM Cortex-M4 for TM4C

Vector table location

The bootloader itself occupies the location where normally the user program's vector table is located. The vector table in the user program therefore needs to be relocated. The bootloader implementation is such that the user program's vector table must be located at address 0x00008000 instead of the standard 0x00000000.

The vector table relocation can be achieved by changing the ROM start address in the linker descriptor file. Refer to the demo program for an example.

Note that the space needed by the bootloader could be different than 0x8000 (32 kbyte), depending on the selected communication interface and compiler. The demo programs are working examples that you can refer to, to determine the exact vector table relocation.

In case you want to manually change the size of the bootloader, make sure the size is aligned to the sectors as outlined in the flashLayout[] array in file flash.c.

Because the bootloader remaps the base address of the interrupt vector table, make sure that your program's initialization routine does not set it back to its origina l location.

Checksum location

A 32-bit checksum value is programmed by the bootloader at the end of a programming session. Upon startup, the bootloader verifies the correctness of this checksum to determine if a valid user program is present and can be started.

The user program must reserve space for this 32-bit checksum value. The bootloader programs this value at the end of the interrupt vector table. To reserve this space, simply enter one extra dummy entry into the interrupt vector table. This reserves space for the checksum at memory address 0x00008266 (0x266 + flash reserved for bootloader). Refer to the demo program for an example.

Stackpointer initialization

On the ARM Cortex-M4 the first entry into the vector table holds the initialization value for the stackpointer, which is automatically loaded into the CPU's stackpointer register upon reset.

After reset, the bootloader gets started first and, if a valid user program is present, it is the bootloaders responsibility to start the user program. This unfortunately means that the automatic initialization of the CPU's stackpointer register does not work for the user program. The user program therefore needs to explicitly set the initial value of the CPU's stackpointer register in the reset interrupt service routine. Refer to the demo program for an example.

manual/ports/armcm4_tm4c.1438936273.txt.gz · Last modified: 2019/09/24 22:14 (external edit)