Hi,
We've created a project for the LPC-Link2/LPC4370 based on the Embedded Artist's labtool codebase. We started there in order to leverage their implementation of HSADC using DMA.
Now we are trying to deploy this firmware by flashing it on our LPC-Link2, but whenever we configure the flash memory, the code crashes. The code will not successfully run from flash, nor will it work from the debugger. If the flash is configured as below, the code will not run. If we remove the flash configuration line, the code runs fine.

The original labtool code goes straight to HardFault_Handler() upon running from the debugger. Our heavily modified code fails upon executing this simple assignment operator in HAL_Reset () (line 81 in Endpoint_LPC18xx.c:
USB_REG(USBPortNum)->ENDPTCTRL1 &= ~(ENDPTCTRL_RxEnable | ENDPTCTRL_TxEnable);
Do you have any insights as to why this may be? How can we get our code to run from flash?
Thanks,
Koray Sahin