Porting from 8051 (silabs) to ARM

Started by dova...@gmail.com May 8, 2007
All,

I\'m new with the ARM arch. and just got two starter kits - 2103, 2148.

i need to port two main application:
1. Bootloader
2. Firmware.

i will start with the bootloader. Its architecture is:
A. the bootloader should listen and act only if the message is for him (i
have multiple listener on the same line):
B. The bootloader gets the decrypt data (of an HEX file) and should write it to the flash (the address of the code is part of the message it gets)
C. After the download, if everything is OK, the Bootloader jumps to the Firmware code
D. there is shared data between the Bootloader and the Firmware

to do all of this i need
1. to enable UART
2. write data (originaly HEX file) into the flash in specific locations

I know it lot of question but will appriciate detailed answer since im very new with the ARM (im using IAR 32Kb version)

Thanks a lot

An Engineer's Guide to the LPC2100 Series

Have a look at this thread...
http://tech.groups.yahoo.com/group/lpc2000/message/24510

You'll make life easier for yourself if you using a polling uart
instead of an interrupt based uart for your boot monitor. On the
LPCs, the term "boot loader" generally refers to the bootloader built
in to the device located in the top 16kb - not something you normally
want to play around with.

The method I used was to build two totally separate projects. One
running from sector 0 (addr: 0x0000 to 0x0FFF) and the other *built*
to run within the confines of sectors 1 to x. You can optionally
write a tricky little boot monitor that revectors all your interrupt
routines, or generic routines that are used for both your monitor and
your primary application. I didn't do either of these, and instead
the primary application totally blats all the SRAM used by the boot
monitor (i.e. resets stacks etc) and copies the first 64 bytes of the
flash image into the first 64 bytes of RAM. Have a look at the above
thread, and look in the datasheet about MEMMAP.

If you have shared data in the form of tables and the likes, as
opposed to share functions, then you can make these part of the boot
monitor image and hard-code them to sector 1 and shift your
application to sector 2 onwards (or whatever you want to do). Then
your application looks at a known address in flash to find the tables.
In theory, this would also allow you to update your flash tables as well

Anyway... these are just ideas. I haven't got much further past
proof of concept, but the above method works for me. It'd pay to
learn a bit about IAP (in application programming). If you don't
think this stuff will work then don't use it :)

If you haven't chosen a dev suite yet I'd strongly recommend Rowley
Cross Works. It's cheap (compared to IAR and Keil), and uses gcc arm
- for which there is a massive knowledge base - and has libraries for IAP.

Have a look in the files section of this group for lots of example
code for use with IAR.

Have fun!
--- In l..., dovalle.y@... wrote:
>
> All,
>
> I\'m new with the ARM arch. and just got two starter kits - 2103, 2148.
>
> i need to port two main application:
> 1. Bootloader
> 2. Firmware.
>
> i will start with the bootloader. Its architecture is:
> A. the bootloader should listen and act only if the message is for
him (i
> have multiple listener on the same line):
> B. The bootloader gets the decrypt data (of an HEX file) and should
write it to the flash (the address of the code is part of the message
it gets)
> C. After the download, if everything is OK, the Bootloader jumps to
the Firmware code
> D. there is shared data between the Bootloader and the Firmware
>
> to do all of this i need
> 1. to enable UART
> 2. write data (originaly HEX file) into the flash in specific locations
>
> I know it lot of question but will appriciate detailed answer since
im very new with the ARM (im using IAR 32Kb version)
>
> Thanks a lot
>