perihp_sdmmc LPC4337 example unable to write on sd card

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

perihp_sdmmc LPC4337 example unable to write on sd card

1,320 Views
arvindprasad
Contributor II

I am using LPC43s67 evaluation board.

I have a custom sd card addon which is connected through sdio interface.

The sd_cd pin is not available on my custom board.

I am using a 4GB SD card with FAT 32 format.

I flash the periph_sdmmc code, but unable to create file or write any test on the sd card.

I am not getting proper output from disk_initialize function.

I have provided the VDD and i am getting proper voltage for SD card interface.

Since i do not have the sd_cd pin I made the sdif_CardnDetect function return(0) manually.

Now hard error "Card Acquire Failed" is coming up.

Can anyone help to resolve the error?

Labels (2)
0 Kudos
7 Replies

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arvind Prasad,

   Please check your sd hardware circuit at first, you can refer to this post:

LPC43S67 periph_sdmmc example error 

  This post is using OM13082 general purpose board , but that board have some error, you can refer to circuit, and do the modification, then test it again.

  I already test the periph_sdmmc code before, it works ok.

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos

892 Views
arvindprasad
Contributor II

Hi Kerry

The error i am getting is same as the one in the link you sent.

I checked my circuit connections. I am getting 3.3v at pin 4.

I have attached the pin break out of the sd card holder i am using

pastedImage_2.png

The CD/ Dat pin is a single line. But in Periph_Sdmmc example, I am asked to connect CD to P1.3.

Since it was not possible, i made the card detect function to return(0). Is it the right way to do it?

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arvind Prasad,

   You don't need to modify the sdmmc code.

    About the CD pin, if you don't have this pin,  please connect the your LPCXpresso LPC4337 pin P1_13 to ground.

   Please try it again on your side.

Any updated information, please let me know!


Have a great day,
Kerry

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

0 Kudos

892 Views
arvindprasad
Contributor II

Hi kerry

Tried connecting P1.13 to ground as well. Still not working. This is the Error I am getting in my terminal window.

pastedImage_1.png

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arvind Prasad,

   Please give me a picture about the board connection.

   Besides, you also can use the logic analyzer to check the communication wave between the SD card and the LPC board.


Have a great day,
Kerry

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

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arvind Prasad,

   Your list is correct.

    What the SD card package you are using?

    As I know, the SD card slot package have the larger package which like the OM13082 general purpose board.

   There are also have the mini SD card slot package.

   Different sd card slot have different package or the pin number sequence.

   Take OM13082 general purpose board as an example, it is the larger SD card slot, the pin sequence is like this:

pastedImage_1.png

   If the mini SD card slot, different slot have different pin sequence.

  You must make sure your MCU SPI pin is connect to the correct pin number.

  Do you have OM13082  board? Or the standard SD card slot board which works before? You must to keep the hardware is correct.

   About the software, I have test it, it can work on our side, I also check this code with the LPCXpress LPC43S67 with the standard mini sd card slot like this:

pastedImage_1.png

It also works.

Before you test the SD card, please also format it with the FAT32 in the PC side.


Have a great day,
Kerry

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

0 Kudos

892 Views
arvindprasad
Contributor II

Hi lpcware‌ n kerryzhou

I am using and OM13084 evaluation board.

The SD Card Package I am using is Amphenol 101-00303-** on a custom board.

I have made all the circuit connections as per what you have shown in your image.

But from my SD Card  package, the Sdat3 and cd are in a single pin, in pin 2. So i do not have a dedicated CD line coming out of my custom board to connect to P1.3 of the evaluation board

pastedImage_1.png

In order to overcome this issue I made the Card detect function in sdif.c to return a zero. Will this work?

0 Kudos