diff --git a/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/LPC407x_8x_177x_8x.h b/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/LPC407x_8x_177x_8x.h index 2a2220b0d86..c7ff650716a 100644 --- a/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/LPC407x_8x_177x_8x.h +++ b/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/LPC407x_8x_177x_8x.h @@ -209,7 +209,9 @@ typedef struct __IO uint32_t EXTPOLAR; /*!< Offset: 0x14C (R/W) External Interrupt Polarity Register */ uint32_t RESERVED6[12]; __IO uint32_t RSID; /*!< Offset: 0x180 (R/W) Reset Source Identification Register */ - uint32_t RESERVED7[7]; + uint32_t RESERVED7[1]; + __IO uint32_t MATRIXARB; /*!< Offset: 0x188 (R/W) Matrix Arbitration Register */ + uint32_t RESERVED71[5]; __IO uint32_t SCS; /*!< Offset: 0x1A0 (R/W) System Controls and Status Register */ __IO uint32_t IRCTRIM; /*!< Offset: 0x1A4 (R/W) Clock Dividers */ __IO uint32_t PCLKSEL; /*!< Offset: 0x1A8 (R/W) Peripheral Clock Selection Register */ diff --git a/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/system_LPC407x_8x_177x_8x.c b/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/system_LPC407x_8x_177x_8x.c index fbfe88bb20d..835d31b4a59 100644 --- a/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/system_LPC407x_8x_177x_8x.c +++ b/hal/targets/cmsis/TARGET_NXP/TARGET_LPC408X/system_LPC407x_8x_177x_8x.c @@ -567,5 +567,15 @@ fpu_init(); SCB->VTOR = 0x00000000 & 0x3FFFFF80; #endif #endif + + /* Must set ROM_LAT bit in the Matrix Arbitration Register otherwise SPIFI + * initialization will cause debugging to HardFault */ + LPC_SC->MATRIXARB |= (1<<16); + + /* Reset LCD Controller to prevent strange behavior when doing a partial + * reset (happens when debugging). + */ + LPC_SC->RSTCON0 = 1; + SystemCoreClockUpdate(); } diff --git a/libraries/net/eth/lwip-eth/arch/TARGET_NXP/lwipopts_conf.h b/libraries/net/eth/lwip-eth/arch/TARGET_NXP/lwipopts_conf.h index a117fa6c93e..e78e3d258e0 100644 --- a/libraries/net/eth/lwip-eth/arch/TARGET_NXP/lwipopts_conf.h +++ b/libraries/net/eth/lwip-eth/arch/TARGET_NXP/lwipopts_conf.h @@ -27,4 +27,10 @@ #define MEM_SIZE 16362 #endif +#if defined (TOOLCHAIN_GCC_CR) + /* For LPCXpresso IDE above v8.0.0 to avoid clash with timeval struct */ + #include + #define LWIP_TIMEVAL_PRIVATE 0 +#endif + #endif diff --git a/workspace_tools/export/codered_lpc4088_cproject.tmpl b/workspace_tools/export/codered_lpc4088_cproject.tmpl index 9d3231cf80e..35ffa7c39a6 100644 --- a/workspace_tools/export/codered_lpc4088_cproject.tmpl +++ b/workspace_tools/export/codered_lpc4088_cproject.tmpl @@ -56,7 +56,7 @@ {% endfor %} - -