TWR-K70 SDHC with SDMA

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

TWR-K70 SDHC with SDMA

1,185 Views
yuetaoma
Contributor I

Hello, there is an inexplicable issues about SDHC of k70 to confuse me. I am developing SD card driver. I found when the sdhc is set multiple block transfer mode and use internal SDMA to transfer data, the data can’t be written into the sd card  completely. For example, in my test case, I want to write 4k bytes data to SD card, the driver will use 3 times DMA transfer to finish the work. The first time DMA transfer 1

data block, the second time DMA transfer 4 data blocks, and the third time DMA transfer 3 data blocks. But after the operation finished, I saw there is no expected data in SD card by the second and third time DMA. In general, I often see the last one or two block data of 2nd and 3rd DMA is not in SD card, the expected data of the these blocks is replaced by 0. When I do this test once again, maybe other block is replaced by 0 and the block filled by 0 in previous test is written into the expected data value.

I check the SDHC_IRQSTAT register after every DMA transfer finishes and no any error occurs. I also check the SDHC_DSADDR and SDHC_BLKATTR, the DMA address is updated correctly and the block number and size value is set correctly too. And the DMA buffer address is 0x20000830, this address is in 0x2000_0000–0x200F_FFFF and the cache mode is non-cacheable. So all these set looks OK and I don’t know why the data can’t be written into SD card. How can I debug or go forward?

Any advice is appreciated. Thanks in advance.

Labels (1)
Tags (3)
0 Kudos
Reply
5 Replies

806 Views
mjbcswitzerland
Specialist V

Hi

Check the K70 mask that you have and the errata that belongs to it. There are various issues with ADMA and the SDHC as shown below (eg. from 3N96B)

pastedImage_0.png

You may find that you need to follow workarounds to solve some difficulties.

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
Reply

806 Views
yuetaoma
Contributor I

Hi Mark,

Thank you four your advice.

I have checked this errata list before and didn't find which errata id is matched with my issue. I try to transfer the data with signle block by SDMA, all the data can be written into sd card by this way, but when I try to read it from sd crad, the similiar issue like writing data occurs, the data is not the expected data and mix some other block data. I have tried to read data with single block mode and multi block mode, the issue always occurs. Do you have any ideas for this?

Thanks in advance.

Thanks,

Yuetao

0 Kudos
Reply

806 Views
soledad
NXP Employee
NXP Employee

Hello Yuetao,

Are you using MQX?

Regards

Sol

0 Kudos
Reply

806 Views
yuetaoma
Contributor I

Hi Sol,

No, I don't use the MQX, I use the vxWorks OS.

Thanks,

Yuetao

0 Kudos
Reply

806 Views
adriancano
NXP Employee
NXP Employee

Hi,

I apologize for the late response. Are you still having the same issues with your project?

Thank you for the information.

Best Regards,

Adrian

0 Kudos
Reply