SDK_2.9.0 LPCXpresso51U68 has new CTIMER Assertion Fault

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK_2.9.0 LPCXpresso51U68 has new CTIMER Assertion Fault

Jump to solution
657 Views
frank5
Contributor II

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.

 

0 Kudos
1 Solution
640 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello frank5,

 

Thanks for your sharing, I will take a ticket to SDK team.

 

Regards,

Alice

View solution in original post

0 Kudos
1 Reply
641 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello frank5,

 

Thanks for your sharing, I will take a ticket to SDK team.

 

Regards,

Alice

0 Kudos