cancel
Showing results for 
Search instead for 
Did you mean: 

SD card reading not working correctly on STM32MP1 during 512 byte read with level shifter

JMein.1
Associate III

Hello community,

the errata says (in combination with the missfunciton of the delay block), that only modes up to DDR50 can be used with the STM32MP1xx.

Actually we now have the problem, that writing to the SD card works well but the reading through the level shifter does have errors.

Now we are afraid, that because of not beeing able to use the delay block, the problems mentioned in the errata are also present with the DDR50 mode.

So, we configured in the device tree the clk_in to be used from the level shifter for the SD card.

Does anyone have an idea, what we can do else to get the SD card running with DDR50? Writing (sychronous delay clock and data through the level shifter) is working fine. Read is working only with errors.

Any ideas what could go wrong? Any idea is welcome to be tested...

Best regards,

Jan-Otto

6 REPLIES 6
PatrickF
ST Employee

Hi @JMein.1​ 

which kind of level translator are you using ? Some translators with automated direction detection maybe too slow. You should use one similar to STM32MP157F-EV1 board.

You need to define the direction pins in the DT and use of CLKIN.

See https://wiki.st.com/stm32mpu/wiki/SDMMC_device_tree_configuration#DT_configuration_examples

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
JMein.1
Associate III

Hello Patrick,

we have been using the one from the ST eval board (NVT4857UK) but this one was no longer available. Now we are using the NVT4858UKZ which is indeed the automatic one. Do you have this one also in test or in usage? The max values seem to be fast enough or even faster as from the eval board oness.

The DT we will double check of course.

Do you have any further ideas, what we can do on this? Are there "manual" delay blocks for the FB line present which we can try?

Best regards,

Jan-Otto

Hi,

did you set

st,use-ckin;

and defined the associated CKIN pin in DT ?

Btw, maybe check if the signals timing and shapes (CMD and Dx on both MP15 and card sides) are ok and in accordance to datasheet.

Maybe there is something wrong (from level translator info, I understand data lanes must be high-level to allow auto direction to work) and the card data lanes does not go from card to MP15.

Maybe some pull-ups on boards are missing or should be stronger.

Did you try to use lower speed to see if it is better ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
JMein.1
Associate III

Hello Patrick,

I would give you a short update.

We now double checked the pin and clock setting in the DT but all is as recommended in the ST WIKI. Now, we had a closer look first to the data lines and measured directly at the SD card connector. The shape looks unfortunately good.

Now we try to measure before the level shifter to compare the clock delay.

Yes, tried to lower the speed and went to 3.3V instead of 1.8V. In this case, we actually have no read errors. A colleague found now an updated ST SD card driver and checks this update. Hopefully this will fix the problem. Otherwise we have to exchange the level shifter. The one from your board is actually not available.

Best regards,

Jan-Otto

JMein.1
Associate III

Hello Patrick,

all the level shifter available on the market are auto-direction level shifter like NXS0506UP is the replacement for the IP4856CX25 used on your eval board STM32MP157F-EV1.

Is there an replacement board from ST which is working fine in combination with an auto direction level shifter for the SD cards?

Best regards,

Jan-Otto

PatrickF
ST Employee

Hi,

we did not have such board.

If on STM32MP15 pins you receive correct data on right time, I did not see any problems with such 'auto' devices.

Maybe you have to debug more deeply (HW wise) what the STM32MP15 pins really receives. Check CLK, CMD, Data, sequence, level and timings are according to MP15x datasheet and SD-Card standard.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.