This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Own Bootloader / IAP

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

Parents
  • 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

Reply
  • 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

Children
  • 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.