Configuration of simple DMA for uSDHC

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

Configuration of simple DMA for uSDHC

854 Views
walterzimmer
Contributor I

Situation:

To access uSD cards I plan to use 4bit wide uSDHC on iMXRT1052. (more precisely I try to port MK66 driver to iMXRT1052). I restrict myself to read/write 512byte blocks. I can initialize the uSD card using the standard commands.

Problem: block read/write do not work properly.

Symptoms: while on MK66 DMA read and write transfer 128 32bit data  (512 bytes), on the iMXRT1052 129 int32 words are transferred (i.e. 1 32 bit word more) . This seems to be some sort of CRC, but a weird one as all 4 bytes in this additional word are equal. It is not clear how this "CRC" is estimated.

The fact that 129 words are transferred is verified by the DMA_System Address.

While reading a uSD block and ignoring the 129th word is no issue, the write operation is nearly impossible, without the proper "CRC" generation. I noted also that sending any word to the uSD card results that uSD card ignores the just written block, confirming my suspicion that the 129th word is a "CRC".

Interestingly the Kinetis MK66 does not require the addition of this "CRC word.

Possible solution: switch off the CRC checking, but what is the command to tell the uSD not to send and receive a 32bit "CRC" word? 

Edit: Alternative Question: what is the right command sequence to tell IMXRT1052 to handle CRC in background (on its own, or automatically)?

0 Kudos
2 Replies

726 Views
walterzimmer
Contributor I

Problem is all solved.

With correct block attributes and correct xfer description simple dma works as expected.

0 Kudos

726 Views
walterzimmer
Contributor I

Problem partially resolved.

A wrong Block Attribute (513 bytes) on IMXRT1052 was reason for reading/writing 516 bytes.

not resolved yet is: using internal simple DMA to write to uSD. At the moment no data are written (verified with HxD)

obviously, the DTD bit in MIX register is cleared for write 

0 Kudos