Include .bin (Bootloader) in Project. I trying to use .incbin in file assenly .S

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Include .bin (Bootloader) in Project. I trying to use .incbin in file assenly .S

1,673件の閲覧回数
vdavi81_cefla
Contributor I

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"

 

0 件の賞賛
返信
7 返答(返信)

1,655件の閲覧回数
vdavi81_cefla
Contributor I

I that I wrote, but the myBootloader.bin doesn't write in 0x000 position

0 件の賞賛
返信

1,651件の閲覧回数
ErichStyger
Specialist I

then just use the address where you wanna have it.

0 件の賞賛
返信

1,662件の閲覧回数
vdavi81_cefla
Contributor I

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:

vdavi81_cefla_0-1670856450415.png

 

0 件の賞賛
返信

1,663件の閲覧回数
ErichStyger
Specialist I

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

0 件の賞賛
返信

1,659件の閲覧回数
ErichStyger
Specialist I

then just use address zero, for example

.text 0x0000 : {
      "myBootloader.bin"
    }    
0 件の賞賛
返信

1,624件の閲覧回数
vdavi81_cefla
Contributor I

I'd like to make some test ... Where I can download Kinetis Flash Tools?

0 件の賞賛
返信

1,621件の閲覧回数
ErichStyger
Specialist I
0 件の賞賛
返信