0
votes

Secondary bootloader for NXP LPC1114/5 Reference NXP app note 10995 Need to use same interrupts in bootloader and user application.

According to NXP AN10995, int vector is only at location 0, and no vector offset reg is available offsetting to other int vector. According to app note, secondary bootloader must redirect processor to handler in user application flash.

Problem/question I have -user application flash will be overwritten during firmware update, so not possible to locate handler there. What is recommended approach, when interrupt will be used by bootloader and user application.

Does this require a conditional redirect, based on the application running (bootloader/user application), such as 1) if bootloader running, re-direct to int handler in bootloader area, 2) if user app running, re-direct to int. handler in user app, or 3) use shared memory between bootloader and user app?

1

1 Answers

1
votes

I've coded many boot loaders / firmware upgrades. If you cannot change the interrupt vectors you need to use polled code, i.e.

  1. Copy the firmware upgrader to RAM, or make sure it's located in an area of FLASH that will not be erased
  2. It's likely that the setup for say the UART is already setup to use interrupts, you need to reconfigure all required hardware to use polled methods, i.e. no interrupts.
  3. Disable Interrupts !
  4. Jump to the firmware upgrade function
  5. The firmware upgrade function will not return, it will poll for messages via the UART and erase, program, verify flash section at the request of the client application. DO NOT ENABLE INTERRUPTS!
  6. When finished, you can reset the Processor using the watchdog to reboot it and execute the new code.