memory allocation for DMA (how to make bdbuf use non-cacheable region for SD card read and write reuqest)
Chan Kim
ckim at etri.re.kr
Wed Sep 2 13:33:39 UTC 2015
Hi, rtems users,
this morning I found the block dev buffer from bdbuf is assigned in cacheable memory.
(the CPU sometimes didn't see the DMA'd data from the SD card, this being affected by printk and following flushing).
So I tried setting the page table so that the buffer coming from the bdbuf is non-cacheable, and then I could remove rtems_task_wake_after(1) at a place (because the read data from SD card is surely seen by the core) immensely reducing the processing time. (20 secs => 3 secs for file write.)
My question is : how come the buffer used for SD card read or write request from the bdbuf is allocated in cacheable memory? I guess there should be setting that tells bdbuf to use some area that the bsp assigned for DMA(non-cacheable). Or , maybe I should map the buffer address to non-cacheable adderss and copyit myself?(should be slow). What is the correct method?
Thanks!
Chan Kim
More information about the users
mailing list