I have to load and run firmware in RAM of an empty Cortex-M4 chip (in a manufacturing environment). The chip ordinarily expects vector table at address 0x0 in flash. When I am loading my firmware to RAM the device flash is empty. My firmware runs okay but interrupt handlers are never called. I do set VTOR to my table in RAM (and it is of course properly aligned).
I found out that when the device starts from the empty state:
- the VECTTBL bit in HFSR is set (obviously it couldn't fetch the vectors from 0xFFFFFFFF)
- VECTPENDING in ICSR is 3 (probably bus fault or hard fault)
If there is already some firmware in flash then my manufacturing firmware runs fine and interrupts work. Clearing the bit in HFSR does not help. Setting VECTCLRACTIVE or VECTRESET in AIRCR does not help.
Question: is there a firmware-controlled way to reset the NVIC or clear the vector table read fault?