[bootloader] Added dual boot

This commit is contained in:
M4x1m3
2022-02-27 00:05:30 +01:00
parent 85ef57f7ed
commit 5a7b076ebe
13 changed files with 226 additions and 32 deletions

View File

@@ -1,12 +1,14 @@
/* Same as flash.ld but everything is linked in internal flash */
MEMORY {
INTERNAL_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 64K
INTERNAL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
SRAM (rw) : ORIGIN = 0x20000000, LENGTH = 256K
}
STACK_SIZE = 32K;
TRAMPOLINES_OFFSET = 0xE000;
FLASH_SECOND_SECTOR_OFFSET = 16K;
FLASH_SECOND_SECTOR_SIZE = 16K;
SECTIONS {
.isr_vector_table ORIGIN(INTERNAL_FLASH) : {
@@ -30,6 +32,20 @@ SECTIONS {
KEEP(*(.header))
} >INTERNAL_FLASH
.rodata : {
. = ALIGN(4);
*(.rodata)
*(.rodata.*)
} >INTERNAL_FLASH
.exam_mode_buffer ORIGIN(INTERNAL_FLASH) + FLASH_SECOND_SECTOR_OFFSET : {
_exam_mode_buffer_start = .;
KEEP(*(.exam_mode_buffer))
/* Note: We don't increment "." here, we set it. */
. = ORIGIN(INTERNAL_FLASH) + FLASH_SECOND_SECTOR_OFFSET + FLASH_SECOND_SECTOR_SIZE;
_exam_mode_buffer_end = .;
} >INTERNAL_FLASH
.text : {
. = ALIGN(4);
*(.text)
@@ -43,12 +59,6 @@ SECTIONS {
_init_array_end = .;
} >INTERNAL_FLASH
.rodata : {
. = ALIGN(4);
*(.rodata)
*(.rodata.*)
} >INTERNAL_FLASH
.data : {
/* The data section is written to Flash but linked as if it were in RAM.
*