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

lpc17xx IAP and booting

Hello everyone, I'm having a little issue with flashing (and booting) program from another program itself running on the flash (IAP).
Let me start by expliciting the context :

- IDE : µvision4
- JTAG controller : ULINK2
- Application board : MCB1700 (with LPC1768 - 512kB on chip flash)

I'm writting an small application for some project, and that works fine. I wan't to be able to update the software directly from the application. Since I will only have an ethernet connexion with the board in the end, I cannot use the on-chip bootloader via the RS-232.

I'm using (or at least trying to) use the following scheme to update the software. I divide the flash in 3 parts: the bootloader , the software 1 and space for the update (software 2). So the Flash memory map looks something like this :

+----------------+ 0x0007 FFFF
|                |
|   Software2    |
|                |
+----------------+ START2
|                |
|   Software1    |
|                |
+----------------+ START1
|   Bootloader   |
+----------------+ 0x0000 0000

The bootloader just decides which software should be booted (by reading relevant information in an EEPROM). The actual flash writing is done from the application, uploading the file is done by using the web serveur in the application.

Now the file transmission via http works fine, my code for writing the flash using IAP routines is sloppy but functional, and the bootloader (which is really a boot chooser) is rolling too.

The problem is that for a software to run it must know at compilation where it will be runned in the memory (I do this by tampering with the scatter file). But this is no good because in the future I don't want to bother about which part of the flash I'm currently using before making an update.
So what can I do (beside writing a real ehternet bootloader) to solve this ?

I hope I have expressed the problem clearly enough. Good day to you all :)