SD CARD communication and TX UNDERRUN error

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

SD CARD communication and TX UNDERRUN error

2,813 Views
aut
Contributor I

Hi all,

with reference to the LPC1788 microcontroller, I have some problems with the SD CARD routines. I'm using  the lpc177x_8x_mci.c routines 2.0 version but I have frequently TX UNDERRUN errors. Is this a my mistake or the NXP routines are not reliables? 

Many thanks   

Labels (1)
0 Kudos
Reply
6 Replies

2,539 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Nico,

 

I recommend you to use the newest LPCOpen library. Inside the library you can check the latest SDMMC card example and drivers. Please download LPCOpen library from the following link.

LPCOpen Software for LPC17XX | NXP

Or If you have MCUXpresso already installed in your PC you can check the examples in the following path.

 

C:\nxp\MCUXpressoIDE_11.0.1_2563\ide\Examples\LPCOpen\lpcopen_2_10_lpcxpresso_ea_devkit_1788.zip

 

I hope this helps.

 

Best regards,

Felipe

-------------------------------------------------------------------------------
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
Reply

2,539 Views
aut
Contributor I

Sorry, in my previous post I was wrong to write. The error isn't TX OVERRUN but TX UNDERRUN  

0 Kudos
Reply

2,539 Views
FelipeGarcia
NXP Employee
NXP Employee

Hello Nico,

 

You are correct, TX underrun means that the FIFO is transmitting data at a higher speed than the speeds the data comes to the FIFO.

 

Unfortunately, the only way to avoid this issue is to make sure that your FIFO has always values so your FIFO will not be empty when a new transmission request arrive, triggering FIFO underrun.

 

Hope it helps!

 

Have a great day,
Felipe

-------------------------------------------------------------------------------
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
Reply

2,539 Views
aut
Contributor I

Hi Felipe.

Doing various tests, the problem occurs also in reception (TX OVERRUN) which is worse than the TX UNDERRUN because you can't recover it in any way (more data comes than that the uP can manage). Both problems (TX OVERRUN and TX UNDERRUN) don't occur up to a clock frequency of 3MHz. I unfortunately would like to go much higher, at least 15MHz. The value 20MHz would be ideal. I have to try using the DMA. Do you think it will work well?

Thanks

0 Kudos
Reply

2,539 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Nico,

 

DMA will definitely allows you to transfer at a higher frequency. However, you will need to test first if it fits the frequency you need.

 

Best regards,

Felipe

0 Kudos
Reply

2,539 Views
aut
Contributor I

Hi Felipe.
Many thanks for your advice.

For the moment I by-passed the problem by writing or reading again the block (512 byte) where the problem has occurred. In this way, the data exchange goes on and ends successfully. I looked the last library version you recommended me but I didn't try it. Aniway, it seems to me that even in these new routines the data exchange stops if the TX OVERRUN error occurs. I noticed that using 400KHz clock the problem never occurs. Increasing the clock the problem starts and it becomes more and more frequent when the clock is increased up to 15MHz.

I don't use the DMA, I use the FIFO interrupts. If I well understood, the problem occurs because the FIFO emptying is much faster than the FIFO loading. Maybe it is normal with the FIFO interrupts. My question now is: is there any why to avoid the TX OVERRUN error?

Thanks

0 Kudos
Reply