Content originally posted in LPCWare by PeterZos on Mon Sep 28 04:10:39 MST 2015
We made a workaround and connect P6_9 to reset circuit (it could also be directly to CPU's RESET pin - active low)
We also write HardFault handler:
__attribute__ ((section(".after_vectors")))
void HardFault_Handler(void)
{
while (1) {
volatile uint32_t i;
Chip_SCU_PinMuxSet(6, 9, SCU_MODE_FUNC0);
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 3, 5);
for (i=0;1<1000000;i++)
{
}
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 3, 5, (bool) false);
NVIC_SystemReset();
}
}
after reset the pin P6_9 is defined as input pull-up enabled
so the cpu is not in reset state.
if the HardFault handler is triggered, pin P6_9 is set to output and pin state is set to low so the chip reset it self.
Regards
Peter Žos