We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hallo
Is it possible to link two application together? (HEX or ELF) I have a bootloader and an application. It would be nice, to link the bootloader to the application each time its build. The application needs the bootloader to launch, so I have to change the application flash location to 0x0000 each time I whant to debug it.
My idea is to link the bootloader.hex and the Application.hex together, but keep the the two separate in BIN files. The bin files are for in-field updates via the bootloader and the HEX file is for production (Get the bootloader+app onmto the target in production)
/Thomas
Maybee its because I dont know how to get two seperate application in one project!!?
The bootloader code has to be placed from adress 0x0000 The application code must be placed from adress 0x1000 (Sector 0 for bootloader, Sector 1-7 for application)
How can that be handle from within a single project?
It would be cool to have the bootloader and application code in one project.
How do you handle the application upgrade? Does the bootloader code run from RAM, and then the complete flash is written (Bootloader and application) or is it just the application?
Thomas
Each target can specify a full set of parameters (including processor type, ...)
For LPC23xx projects, I run both from flash. The boot loader gets the flash interrupt vectors. The application vectors gets copied to RAM and then remapped.
The flash is splitted into a small region for the boot loader and two large areas for the application. Any download is performed by the running application into the other application area.
The boot loader may use any amount of RAM and any peripherials it likes. It has a 4kB flash sector where it may check for current configuration. Depending on information found there and contents of two identical-sized application areas, the boot loader makes a decision what to do. It can use a 16-byte RAM area to send a message to the application. The application can use the flash sector to force the boot loader to accept/reject an application area etc or possibly affect baudrate or similar.
A binary with a new application contains both the binary data, and a header with crc32 and version information. The application will not be accepted if not correctly transmitted. And the boot loader will not touch a downloaded application with invalid crc32.
The boot loader will support any version of application, until we possibly decide to create a version with another memory layout, but we currently have support for two (or maybe it is three) different memory layouts in the applications and the boot loader. The different memory layouts affects how much flash space that is reserved for application code, and what flash sectors that are reserved for application data (configurations, alarm states, log info, ...)
The application is able to pick up the boot loader version, so it will know how good the boot loader is. In theory, the application has support to also replace the boot loader, but this is a dangerous step that we do not want to use unless the alternative is to manually visit all units. A failed boot loader update will (!) result in a need to send the unit to a service center since there is no way to perform an atomic switch of the boot loader.
That was a quick summary - the full requirements and test specification is quite a bit longer :)
I see..
But how doi I setup, so the bootloader and application is handle in the same project?
The bootloader source code must be build to a specific flash sector. The application source code must be build to another flash area. The application must be build to a BIN file The bootloadet and application must be build into a merged HEX file.
Is that possible? Or is the hex2bin/bin2hex the best way of doint this?