Can't build combined file with linker

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

Can't build combined file with linker

700件の閲覧回数
Guy_mego
Contributor II

Hey All,

I'm using LPC1765 and MCUXpresso IDE v24.9.25.
I have 2 projects, the first one is secondary bootloader, and the second is the main FW.
I was trying to build a combined file so the bootloader will start on address 0x0 until 0x7000 and the FW will start from 0X7000 to the end. 
I wrote the linker as the following: 


arm-none-eabi-size "${BuildArtifactFileName}"
-print-memory-usage
arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"
arm-none-eabi-objcopy -O ihex ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.hex
# checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"
cat "${WorkspaceDirPath}\912LT_Bootloader\Debug\912LT_Bootloader.hex" "${BuildArtifactFileBaseName}.hex" > "912LT_Combined.hex"

and also the ld liner script file of the memory: 


MEMORY
{
/* Define each memory region */
MFlash256 (rx) : ORIGIN = 0x7000, LENGTH = 0x38000 /* 256K bytes (alias Flash) */
crcSection (rx) : ORIGIN = 0x38000, LENGTH = 0x4 /* 4 bytes (alias Flash2) */
progsizeSection (rx) : ORIGIN = 0x38004, LENGTH = 0x4 /* 4 bytes (alias Flash3) */
progstartSection (rx) : ORIGIN = 0x38008, LENGTH = 0x4 /* 4 bytes (alias Flash4) */
RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32K bytes (alias RAM2) */
}

I can't figure why the linker doesn't create me a combined file.
I will appreciate any assist in the issue.

Thanks in advance. 

 

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

673件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Guy_mego 

It's difficult to include hex file to linker file. But there is a way to include bin file with linker. See this article below:

https://mcuoneclipse.com/2022/06/17/include-bin-binary-files-in-a-gnu-linker-file/

 

Hope this helps,

Jun Zhang

 

0 件の賞賛
返信

642件の閲覧回数
Guy_mego
Contributor II

Hi  ZhangJennie,
Thanks for your answer.

The way I mentioned in my post worked for me with another project. 
Since in my project I'm using FOTA that works based on hex file, I've must created a combined hex file. 
Is there something else I can or may I missing something in my linker script?

0 件の賞賛
返信

608件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Guy_mego,

We can't combine hex files directly. We suggest converting hex to bin then combining bin files with the article's method.

Hope this helps,

Jun Zhang

0 件の賞賛
返信