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.
Hi all,
hope I did not miss a similar topic here. I searched, but did not find anything appropriate.
I want to have my device (LPC2368) to be updatetable via USB. To accomplish that, I think about two separate applications, a simple + small USB program (as H I D device, located at adress 0) that, upon reset checks for an USB link and, if none exists, starts the second "main" application, starting at address, say 0x8000.
Upon an USB connection at startup, the bootloader would erase/program the flash using IAP.
How do I have to set up uVision/the linker to build this application a) at adr 0 for debugging / test purposes and b) at the higher address for release versions
any tips highly appreciated kind regards + thanx in advance
thanx all, esp. Per. That double bootloader stuff sounds quite smart to me.
Meanwhile I managed to get the main app to load at a higher address and had a first in depth look at all the scattering.
The question remains if/ how I can manage to switch between the two different application types (app for debug at 0, app for distribution eg at 0x8000)
the scatter file requires a define, my 'C' application should have a define and the bootloader code needs a define too. Is it possible to reduce that to one single position to switch ?
HI
I have to push this topic up as I still see no solution. Other IDEs provide means for different "build types" eg "Debug" or "Release". This would be the solution here as I (afaik) have many different options to switch in order to compile for low or high load. (eg ASM switch for bootloader, entry point, a 'C' define ..)
Can't I have those two different project types in one uV session and switch by one single flag ?
tia Uli
Hi Uli
think about 2 applikations.
The first one is a normal and can store data in the flash (the bootware)
Booting, checking if the data contains valid stuff and either starts the code at 0x8000 or switch to a selfwritten download routine.. waiting for data over CAN, comX, USB Ethernet or what ever.. your have to write it.
The firmware is a second and independence application createt with UV3. Just change the address-range in option - target from 0x000 to 0x8000. Use vectortable in RAM and copy at firmwarestart the table from 0x8000 to 0x40000000.
Starts from bootware in ARM-mode the address 0x8000.. To download a one the firmware is able to erase one flash sector and cause than a reset, the bootware detects this and runs the doownload-part.
works great :)
You can have two targets in the project file. You can use different scatter files for the two targets.
Guenter: thanx
Per: double thanx. That was the option I was looking for. I must say it is hidden well under "manage components" .. :) but that is what I was looking for.
ULI
Which advantage do the programer has from the way with 2 scatter files?
And what is with source code files? 'Bootware' and 'firmware' use diffenrent sets of files..
When i try to add files in target A they appear also in target B. But there are only few files which must be in both projects.
Guenter
You can specify which files that should be built for the different targets. You may have common code - such as CRC32 or similar - that should be built by both targets.
Two scatter files means that the boot loader and the application hsa completely different sets of memory available for the linker to use. If you don't need to advanced layouts, then you don't need manually created scatter files, but could just define two sets of memory mappings directly in the property dialogs.