I need to insert a Bootloader developed by an employer of my company.
He gives me, a .bin file. I tryied to use .incbin Assembly directive, but at the end of buildind when I check if bootloader is present in section .bootloader (I created this section only for bootloader), I see that the bootloader section is empty. I see only zero value.
{
/* Define each memory region */
m_bootloader (rx) : ORIGIN = 0x00000000, LENGTH = 0x00008000
PROGRAM_FLASH (rx) : ORIGIN = 0x00008000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
SRAM_UPPER (rwx) : ORIGIN = 0x20000000, LENGTH = 0x10000 /* 64K bytes (alias RAM) */
SRAM_LOWER (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x10000 /* 64K bytes (alias RAM2) */
FLEX_RAM (rwx) : ORIGIN = 0x14000000, LENGTH = 0x1000 /* 4K bytes (alias RAM3) */
}
SECTIONS
{
.bootloader :
{
. = ALIGN(4);
KEEP (*(.bootloader))
. = ALIGN(4);
} > m_bootloader
/* MAIN TEXT SECTION */
.text : ALIGN(4)
{
And the bootloader.S file:
.section .bootloader, "a"
//.align 2
.incbin "/bootloader/Bootloader_MK22_Base.bin"