cancel
Showing results for 
Search instead for 
Did you mean: 

Communicate with an sd card with cubeide and nucleo f767ZI board

LauraCx
ST Employee

Hi, I'm trying to communicate with an sd card with cubeide and nucleo f767ZI board and I've been able to read and write data successfully with sdmmc sd 1 bit mode. 

However, in my project I also need to use uart communication and whenever I activate any of the uarts available. I can no longer write to any file on the sd card and only the read remains available.

Does anyone have an idea or insights how to fix that ? 

** Question moved by moderation @YDrid.1​

3 REPLIES 3

UARTS shouldn't directly impact the SDMMC. Timing is critical during data transfer phases, if the SDMMC is Polled, UART interrupts and callbacks can create a lot of drag. Would suggest using DMA for data transfer on SDMMC.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you @Community member​. I'm already using DMA in the uart.

In that case, should I define priorities in the DMA configuration ?

Do you have any suggestions how to achieve that ?

DMA operates very fast, at bus speeds, in a round-robin servicing methodology, I can't see a USART creating enough load to be worrisome. And SDMMC has a reasonable deep FIFO. What it can't sustain is code wandering off in some interrupt/callback for dozens of milliseconds (tens of thousands of machine cycles). The POLLing code is very fragile, as the burst rate of the SDMMC can be very high.

For the F7, use the DTCM RAM for the DMA buffers, then you don't have to worry about cache coherency issues. Be aware of buffer alignment. If doing active cache managment of other memory areas, be aware of those cache line alignment expectations, and keep other critical variables away from the front/end of the buffer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..