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.
I am trying to write a firmware loader for an LPC2132. So far I have code that retrieves a HEX file via USB and saves it to the on chip flash. I want this code to remain in flash so that I can update the firmware any time.
The problem I am having though is figuring out how do I compile and link the main code (the code that can be changed via the loader) so that I can just jump to it and start its execution from the loader.
What I have tried so far is compiling the loader and the main code separately. The main code I confine it to 0x4000 and up, while I confine the loader to 0x0000 .. 0x3FFF. The I go into the HEX files and merge the loader file with the main code (using only 0x4000 and up). This doesnt work at all.
Any help will be greatly appreciated.
1. bootloader(code+ram) and main(code+ram) must be separated. 2. main(ram) cann't be zeroinit,zeroinit by user code. 3. main's function called by bootloader must be in fixed address. 4. bootloader's function called by main cann't be changed.