-
Notifications
You must be signed in to change notification settings - Fork 4
Bootloader & Bootup
This page details the operation of the chip until the programmed firmware (EEVBlog.bin) begins execution.
The chip Vector Table contains a list of routine addresses to execute on certain events, such as interrupts. The second 32-bit word of this table is the address of the RESET routine (+ 1 to enter Thumb mode).
The bootloader occupies addresses 0x08000000 (start of flash) to 0x08006000 (start of programmed firmware). It has a Vector Table at the beginning. It is entirely responsible for the process of checking the buttons, reading a firmware file from the SD card, and programming it to the flash. Once the bootloader has finished, it transfers control to the programmed firmware.
- At hardware reset, the chip begins execution based on the bootloader's Vector Table (at 0x08000000).
- If the appropriate buttons are held, the bootloader runs the IAP routine.
- Else, the bootloader prepares to transfer control to the programmed firmware.
- The bootloader jumps to the start of the programmed firmware based on the programmed firmware's Vector Table (at 0x08006000).
- The programmed firmware begins execution. At some point, it changes the chip Vector Table location (using the VTOR register) from 0x08000000 to 0x08006000 so that the programmed firmware interrupt routines are executed instead of the bootloader's.
- The programmed firmware is now running with full control over the hardware.
The EEVBlog.bin file is just a blob of bytes that the IAP routine programs at 0x08006000 onward. While it can technically have any contents, it must start with a Vector Table so that the bootloader can properly transfer control.