mbedmicro/mbed — pull request #293 by hollie (2014-05-05 12:48:45+00:00)
Title: Ensure the NVIC table gets copied to RAM even when it is not at 0x0000

When using user application code on an actual mbed the original code runs fine.

However, when migrating from a prototype to a bare metal controller that is running on a circuit designed from scratch you typically implement a secondary boot loader that enables updating the flash from USB or from an SD card. This secondary bootloader requires that you compile the mbed-based application code with an offset. Before jumping to the application the SCB->VTOR register is set to the correct offset for the vector table in the application code (in flash).

Here lies the catch: the mbed startup code checks if the SCB->VTOR == 0x0000 and if it is not the case it does not copy the vector table to RAM. It also tries to adapt the table, which is not possible (the application cannot write to the flash memory).

With the proposed fix the code runs fine with or without a bootloader.