SD Card Assert

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

SD Card Assert

867 Views
mspenard603
Contributor IV

Hi Gents,

 I occasionally get the following error when trying to use an SD card after initializing it:

ASSERT ERROR " index <= 7 ": file ".fsl_clock.h" Line "978" function name "CLOCK_ControlGate"

Which references the following:

static inline void CLOCK_ControlGate(clock_ip_name_t name, clock_gate_value_t value)
{
uint32_t index = ((uint32_t)name) >> 8U;
uint32_t shift = ((uint32_t)name) & 0x1FU;
volatile uint32_t *reg;

assert(index <= 7);

reg = ((volatile uint32_t *)&CCM->CCGR0) + index;
*reg = ((*reg) & ~(3U << shift)) | (((uint32_t)value) << shift);
}

But I'm unsure what error this indicates... ??

0 Kudos
4 Replies

856 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'd like to know more information about the error.
So I was wondering if you can share which version of SDK and EVK board you tested with.
In further, whether you find a way of replicating the error and what the index's value was when trigger the error.
Looking forward to your reply.


Hope it helps.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos

847 Views
mspenard603
Contributor IV

Index at failure:

 

SD Card detected
Card Init
kCLOCK_Pfd0 Freq: 594000000Hz
kCLOCK_Usdhc2Div: 2 +1
ROOT SD_HOST_CLK_FREQ: 198000000Hz
SD BUS CLOCK: 5500000Hz
[SYSTEM ERROR] Mount volume failed:3 0
Retrying mount in 100 ms
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! index: 1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! index: 1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! index: 16777215
ASSERT ERROR " index <= 7 ": file ".fsl_clock.h" Line "981" function name "CLOCK_ControlGate"

0 Kudos

838 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
According to your reply, I guess that the issue may be related to the hardware circuit.
I'd like to suggest you try to slow down the SD bus clock, then give it a try again.
Further, I'd like to suggest you use either a logic analyzer or an OSC oscilloscope to visualize the signals during initializing the SD card, it can help us to figure the issue out.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

850 Views
mspenard603
Contributor IV

Hi Jeremy,

 Thanks for the reply. SDK is 2.5.1 and this is with our own PCB. It happens rarely, maybe 1 out of 100 boots. I'll update the printf() to output the index value.

0 Kudos