Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | Re: remote programming for LPC2148

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

remote programming for LPC2148 - Sutton Mehaffey - Oct 8 11:34:18 2008

I have enough code space to hold 2 versions of code. I plan to have a
boot block that can be changed to execute out of block 1 or block 2
and provide the mechanism for remote upload.

I haven't decided yet, but block 1 may be a factory fallback block and
block 2 might be my new code uploaded remotely. I might even
overwrite block 1 with block 2 when I decide the new code has been
working correctly for some time and then reuse block 2 for new
updates. However, if there is a crash during the overwrite, then you
are up the creek, so I haven't decided on that yet.

Anybody see any other holes I should be aware of? How have others
accomplished this? Also, is there 'C' code to start executing out of
a particular place in flash? Or is this done by assembly language?
Thanks.

Sutton

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: remote programming for LPC2148 - Jan Vanek - Oct 8 12:14:30 2008

Hi Sutton,

I partition the flash to 4 parts:
1. boot-app
2. main-app
3. space for main-app upgrade
4. registry

The boot-app can't be changed. It is very short application which does only one thing: it looks into registry whether there is a 'request' to copy the new version of the main-app from the part 3 into part 2. If so, it does the upgrade and reset the 'request' in the registry. Then it jumps to the main-app.

The main-app is 'somehow' able to get new version of itself (from UART or USB or SD card) and copy it to part 3. Then it sets the request in the registry (part 4) and resets the processor, so that the boot-app can finish the upgrade.

I can't change the boot-app, because if I'd try, there would be a moment where the 1st flash sector - the address where the processor jumps to when powered on (or the address from which it reads the addres to jump to) - would be invalid. So I keep it very simple (< 2kB).

The potential problem is when I upgrade to a buggy new version of the main-app, which is not able to initiate the upgrade of itself, to copy new version of itself to part 3 and set the request in part 4. So I have to test properly before I release.

Also, because the boot-app can't be changed there is a 'problem' with the vector table. It is processor specific. On STM32F101 I can set the address of the vector table. On LPC2888 it is not possible, but I can keep the address of 2nd level IRQ handler table in INT_VECTOR0 register (and I had to slightly change the assembly code of the 1st level IRQ handler (linked into boot-app) to jump to correct IRQ handler from table pointed by INT_VECTOR0).

With regards,
Jan

----- Original Message -----
From: Sutton Mehaffey
To: l...@yahoogroups.com
Sent: Wednesday, October 08, 2008 5:34 PM
Subject: [lpc2000] remote programming for LPC2148

I have enough code space to hold 2 versions of code. I plan to have a
boot block that can be changed to execute out of block 1 or block 2
and provide the mechanism for remote upload.

I haven't decided yet, but block 1 may be a factory fallback block and
block 2 might be my new code uploaded remotely. I might even
overwrite block 1 with block 2 when I decide the new code has been
working correctly for some time and then reuse block 2 for new
updates. However, if there is a crash during the overwrite, then you
are up the creek, so I haven't decided on that yet.

Anybody see any other holes I should be aware of? How have others
accomplished this? Also, is there 'C' code to start executing out of
a particular place in flash? Or is this done by assembly language?
Thanks.

Sutton

#ygrp-mkp { BORDER-RIGHT: #d8d8d8 1px solid; PADDING-RIGHT: 14px; BORDER-TOP: #d8d8d8 1px solid; PADDING-LEFT: 14px; PADDING-BOTTOM: 0px; MARGIN: 14px 0px; BORDER-LEFT: #d8d8d8 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #d8d8d8 1px solid; FONT-FAMILY: Arial}#ygrp-mkp HR { BORDER-RIGHT: #d8d8d8 1px solid; BORDER-TOP: #d8d8d8 1px solid; BORDER-LEFT: #d8d8d8 1px solid; BORDER-BOTTOM: #d8d8d8 1px solid}#ygrp-mkp #hd { FONT-WEIGHT: bold; FONT-SIZE: 85%; MARGIN: 10px 0px; COLOR: #628c2a; LINE-HEIGHT: 122%}#ygrp-mkp #ads { MARGIN-BOTTOM: 10px}#ygrp-mkp .ad { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}#ygrp-mkp .ad A { COLOR: #0000ff; TEXT-DECORATION: none}

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: remote programming for LPC2148 - jsm09a - Oct 8 15:51:56 2008

--- In l...@yahoogroups.com, "Sutton Mehaffey" wrote:
>
> I have enough code space to hold 2 versions of code. I plan to have a
> boot block that can be changed to execute out of block 1 or block 2
> and provide the mechanism for remote upload.
>
> I haven't decided yet, but block 1 may be a factory fallback block and
> block 2 might be my new code uploaded remotely. I might even
> overwrite block 1 with block 2 when I decide the new code has been
> working correctly for some time and then reuse block 2 for new
> updates. However, if there is a crash during the overwrite, then you
> are up the creek, so I haven't decided on that yet.
>
> Anybody see any other holes I should be aware of? How have others
> accomplished this? Also, is there 'C' code to start executing out of
> a particular place in flash? Or is this done by assembly language?
> Thanks.
>
> Sutton

Briefly ...

- Our boot loader (never updated)
- Main Application
- Backup/New Application

Boot loader confirms it's CRC, and then CRC for Main Application. If
Main App CRC is OK - Main application is launched.

If Main App CRC is NOT OK (and backup/new is OK), boot loader erases
Main Application area and copies backup/new into there. If copy
succeeds, (Newly Copied) Main Application is launched.

To install new application, erase new/backup area and copy new code
into there. As very last step, corrupt first page of Main Application
and force WDT reboot.

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )