Compiling multiple projects (fNET bootloader and firmware) in MCUXpresso IDE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiling multiple projects (fNET bootloader and firmware) in MCUXpresso IDE

1,921 Views
luigicapogrosso
Contributor II

I'd like to compile two separate projects into one binary file - with MCUXpresso IDE - to flash onto my board. One is the bootloader (I use the fNET bootloader) and the another one is the firmware.

How I can merge my bootloader binary with the application project and load it as a single .bin file without the fact that bootloader and firmware overlap in the Flash Memory?

I have to adjust both projects (bootloader and firmware) with custom linkscripts files?

5 Replies

1,918 Views
ErichStyger
Specialist I

Hi @luigicapogrosso ,

I'm using the srec_cat tool to do this kind of manipuluation, see https://mcuoneclipse.com/2016/02/26/merging-s19-files/

That tool works with all kind of formats and can work with binary files too.

See as well https://mcuoneclipse.com/2018/03/05/tutorial-crc32-checksum-with-the-kboot-bootloader/ for some more advanced file manipulation.

I hope this helps,

Erich

0 Kudos
Reply

1,904 Views
luigicapogrosso
Contributor II

Hi @ErichStyger,
thanks for your response.

So, with the srec_cat tool the memory management is automatically managed? And, if I want merge my fNET bootloader with the application project using MCUXpresso IDE what I have to do?

1,887 Views
ErichStyger
Specialist I

Hi @luigicapogrosso ,

Yes, srec_cat cares about merging files. See for example https://mcuoneclipse.com/2016/02/26/merging-s19-files/

In case you are not aware: you can easily debug multiple application parts, see https://mcuoneclipse.com/2020/11/03/debugging-bootloader-and-application-with-one-debug-session/

 

I hope this helps,

Erich

0 Kudos
Reply

1,873 Views
luigicapogrosso
Contributor II

Hi @ErichStyger,
firstly, thanks a lot for your support. I'm beginning to understand more and more.

I read the article Debugging Bootloader and Application with one Debug session and almost everything is clear. But, how do I know what is the firmware address to give to the "go" command of the bootloader?

Because, if I understand correctly, I attach my application to a bootloader (that is already flashed). So, when I start the debug session I see the fNET shell command. After that I should set the address of the application and start it with the "go" command. So, where can I see the final address of the bootloader and the initial address of the application?

1,865 Views
ErichStyger
Specialist I

Hi @luigicapogrosso ,

I cannot comment on the fNET bootloader as I'm using the MCUXpresso SDK bootloader (see for example Flash-Resident USB-HID Bootloader with the NXP Kinetis K22 Microcontroller | MCU on Eclipse). In the MCUXpresso bootloader the bootloader is configured with an application base offset (say 0xA000) and the bootloader loads an application with the blhost there (or checks if there is an application present at this address). The application uses the BCA (Bootloader Configuration Area) to configure other things.

I assume the same for your bootloader as this is pretty much the standard way how bootloaders work.

I hope this helps,

Erich

0 Kudos
Reply