Hi,

I am getting the SAMA5D27 SDMMC SD Card driver pull request ready. There's
one small issue I'm working on, though. There's a place in the driver
initialization where I calloc() some memory– 466 bytes. DMA data transfers
while reading from files times out if I don't have the calloc() in there.
With the memory allocated, everything works fine. Nothing writes to this
block of memory– I memset it and examined it before, during, and after
transfers using GDB. It's just an unused block of memory.

I'm trying to find out if other amounts of memory work– smaller than about
100 bytes doesn't work, and I know it works reliably at 466 bytes. I'll
track the exact number down tomorrow.

But my question is, why does this work? The driver datasheets
<http://ww1.microchip.com/downloads/en/devicedoc/ds60001476b.pdf>don't
mention that the chip needs aligned memory for its buffers, and the Atmel
and U-Boot drivers don't use aligned memory. And since nothing is
overwriting the memory, what is the calloc() doing to prevent the SDMMC DMA
engine from completing the transfer?

If anyone has seen behavior like this, I'd love to know it. I'd like to
take this otherwise useless code out, or at least know why I need it.

Link to the specific line of code in sam_sdmmc.c
<https://github.com/starcat-io/incubator-nuttx/blob/feature/sama5d27-sdmmc-support/arch/arm/src/sama5/sam_sdmmc.c#L3737>

cheers
adam
-- 
Adam Feuer <a...@adamfeuer.com>

Reply via email to