Content originally posted in LPCWare by DF9DQ on Sun Nov 04 05:00:24 MST 2012
That's not the complete truth! :-)
You are right that there is a limitation to the address that can be set in VTOR. It can only start with a certain bit pattern:
000x xxxx xxxx .... ("code space")
001x xxxx xxxx .... ("SRAM space")
The base addresses of these two regions are 0 and 0x2000,0000, which you have mentioned.
However, within these two regions you can set VTOR to any 256-byte boundary (bits 7...0 are unused). The minimum required alignment depends on the number of interrupts implemented in the device. The LPC1700 has a total of 51 interrupts lines (system: 16, user: 35), where a 256-byte alignment suffices. The recommendation is to always align to a 1024-byte boundary, enough for the maximum of 240 user interrupts in a Cortex-M3 implementation.
In our case, setting VTOR to 0x8000 (start of sector 8) is perfectly valid, as it is in code space and more than sufficiently aligned.
Regards,
Rolf