lpcware

LPC11C24 - vector remap generates HardFault

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by bomba82 on Fri Jan 31 01:47:26 MST 2014
Hello,
  I am trying to implement a solution for upgrading firmware using a CAN second bootloader approach.
To do so I need to remap vectors for the application firmware. Since bootloader fits in 2 pages, my application executes from address 0x2000 and then I need to use vector remapping to RAM.

I had success in my first attempt to upgrade firmware with a simple blinky project. The problems arose when I tried to add CAN communication to that simple project: I get a HardFault error after I make the first call to "can_transmit" function.

To simplify things I tried to execute the project in debug configuration from address 0x0000.
If I execute the project without remapping everything is ok.
If I execute the same project trying to remap vectors from 0x0000 to 0x10000000 (SYSMEMREMAP=1) I get that HardFault error. (there is no sense to do that remapping, but it's just to test remapping in the easiest way)

I read the user manual and many threads on this forum but I can't figure out what I am doing wrong. Does someone have any suggestions?

I attach the BlinkyCAN project. It's very simple to view the problem:
1) try to execute the project as provided. It should execute correctly on a LPC11C24 LPCXpresso Board. The LED should blink.
2) Set the "EXCLUDE_CAN" macro to 0. The HardFault problem arises.

Original Attachment has been moved to: BlinkyCAN.zip

Outcomes