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"
I that I wrote, but the myBootloader.bin doesn't write in 0x000 position
then just use the address where you wanna have it.
Thanks,
but I need to have the values of the firmware (It is a bootloader) starting in the mem address zero.. like shown in figure below:
I wrote about including a binary file in the linker file here:
https://mcuoneclipse.com/2022/06/17/include-bin-binary-files-in-a-gnu-linker-file/
I hope this helps,
Erich
then just use address zero, for example
.text 0x0000 : { "myBootloader.bin" }
I'd like to make some test ... Where I can download Kinetis Flash Tools?
It is part of the MCUXpresso IDE: https://mcuoneclipse.com/2020/12/05/standalone-and-command-line-programmer-with-mcuxpresso/