Author Topic: boot loader support in LPC2388  (Read 23402 times)

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: boot loader support in LPC2388
« Reply #15 on: December 14, 2009, 10:25:08 AM »
On the same subject, I want to use flash SPI for boat loader.
I supposed I need to add lpc23xx.c to the uTaskerBootLoader project, but most function are static on this file.
What is the correct way ? Do I change them to be public ?

I didn't find how to compile my project for bare minimum compatibilty (with Keil)
Looking on my map file I saw that a lot of functions are located at start of memory (printf,libinit...)
How can I have my project removing the boot loader part, with stack initialization, and so on ?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3224
    • View Profile
    • uTasker
Re: boot loader support in LPC2388
« Reply #16 on: December 15, 2009, 10:01:41 AM »
Hi Hervé

The way to add SPI FLASH support to the LPC2XXX project is to take the missing functions from LPC23xx.c and put them in LM3SXXXX_boot.c. The files spi_flash_lpc_atmel.h and spi_flash_lpc_stmicro.h should be compatible. Any static functions which are needed by the boot loader file can be made external.


The uVision uTasker V1.4 project should have two targets (uTaskerV1.4 and uTaskerV1.4_BM) - see 'select target'. The BM configuration sets the link address to 0x1000 instead of 0. Otherwise there are no other changes to be made. The initialisation is still needed in the application so no further changes should be necessary.

Regards

Mark

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: boot loader support in LPC2388
« Reply #17 on: December 15, 2009, 02:11:30 PM »
Hi Mark,

Thanks for your comment.
I looked at the project uTaskerV1.4_BM, the only difference I saw was the start address of IROM1 set to 0x1000.
On the linker tab R/O Base was set to 0 : I set the "Use Memory Layout from Target Dialog" so now my code start at 0x1000 with no other code before.

In fact it looks like the bootloader and the application are completely independent programs ??

If I correctly understood the purpose, this project can only be uploaded, then ran from bootloader.
So starting from 0x1000, the stacks and heap can be initialized again to fit the application needs....
But what about the reset or abort handler table? The code will jump to bootloader one, not to application handler, no ?

What about using the simulator with the bootloader, I didn't see any specific configuration ?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3224
    • View Profile
    • uTasker
Re: boot loader support in LPC2388
« Reply #18 on: December 16, 2009, 02:05:40 AM »
Hi Hervé

Yes, the boot loader and application are independent. However it is necessary to both together before they can be used. See the following for the conversion program to combine them: http://www.utasker.com/forum/index.php?topic=627.0 / http://www.utasker.com/forum/index.php?topic=699.0

The code always resets from the boot code. Also the boot code interrupt vectors are used - this doesn't define the interrupt routines though since these are defined in the VIC's vector tables - in registers.

The simulator doesn't need to be able to simulate the BM configuration since the application is essentially identical to the stand-alone application case.

Regards

Mark