Content originally posted in LPCWare by NXP_Paul on Wed Oct 29 08:14:00 MST 2014
Try disabling the Systick interrupt using the following:
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
Then re-enable the interrupt using:
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk;
The Disbale IRQ function states the following in the core_cm3.h file:
/** \brief Disable External Interrupt
The function disables a device-specific interrupt in the NVIC interrupt controller.
\param [in] [u]IRQn External interrupt number. Value cannot be negative.[/u]
*/
If you look in the cmsis_1777x_8x.h file, it shows that the Systick has a negative value:
SysTick_IRQn = -1,/*!< 15 System Tick Interrupt */
I changed your program using the disable/enable as shown above, and there is no longer a hardfault error.
Regards
Paul