Hi All
I'm using STM32L073 and already have a bootloader at 0x8000000 to 0x8002ffff. This bootloader will check the application FW(crc & length) and jump to FW's entrypoint at begging third word of FW image.
The FW image header
// Firmware header __attribute__((section(".fwhdr"))) const volatile boot_fwhdr fwhdr = { // CRC and size will be patched by external tool .crc = 0, .size = BOOT_MAGIC_SIZE, .entrypoint = (uint32_t) _start, };
I want to add the header to image's begging, but i don't know how to edit my scatter file. And can using bootloader check FW OK, than jump to entrypoint to start application. The original scatter file is
LR_IROM1 0x08003000 0x00010000 { ; load region size_region ER_IROM1 0x08003000 0x00010000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x00005000 { ; RW data .ANY (+RW +ZI) } }
You'd really want the vector table at the beginning of the image, otherwise it makes things that much more complicated.
Consider reusing unused vector table entries for the size information and put the CRC at the end of the whole image.
www.keil.com/.../armlink_pge1362065911231.htm www.keil.com/.../armlink_pge1362065993212.htm
Thank you for your advice, but the bootloader will check the crc and length at the beginning , so i need to match the bootloader design. The vector table is startup_stm32l073xx.s?
Ok, so have the boot loader architect work with you and explain/demonstrate his vision