The new 2.9.0 version of the SDK has an issue with CTIMER3 which will cause an assertion fault if the CTIMER_Init() function is called. The problem occurs in line 110 of fsl_ctimer.c, when the RESET_PeripheralReset(s_ctimerReset[CTIMER_GetInstance(base)]);) is called. The new library has a change in LPC51U68.h in line 1730:
#define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, (CTIMER_Type *)0u, CTIMER3 }
Essentially this adds a new, dummy entry for CTIMER2. This change makes the CTIMER_GetInstance(base) return array position 3, which does not exist in s_ctimerReset[], which contains no entry for CTIMER2.
As a result, the Reset operation fails to find a valid bit number and generates an assert crash.
Temporary workaround is to add a dummy value in the CTIMER_RSTS array in fsl_reset.h, at line 125:
#define CTIMER_RSTS \
{ \
kCTIMER0_RST_SHIFT_RSTn, kCTIMER1_RST_SHIFT_RSTn, (SYSCON_RSTn_t)0, kCTIMER3_RST_SHIFT_RSTn \
} /* Reset bits for TIMER peripheral */
This will align the two arrays to both have 4 entries, and allow CTIMER_Init() to work with Timer3.
解決済! 解決策の投稿を見る。