Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
1081 Discussions

DE1-SOC: Baremetal SDCARD reading performance

Altera_Forum
Honored Contributor II
974 Views

Hi, 

 

I try to improve our SDCard reading performance.  

I have tested the speed of sdcard that we will use on our project, and windows can write a big file to it with 10MB/sec and read back with around 20MB/sec. 

 

When I plug same card into DE1-SOC board, I can read only 1.58 MB/sec. And this is after enabling cache, mmu and use high speed setting for MMC interface. 

 

Here is my MMU and MMC settings: 

void mmu_init(void) { uint32_t *ttb1 = NULL; /* Populate the page table with sections (1 MiB regions). */ ALT_MMU_MEM_REGION_t regions = { /* Memory area: 1 GiB */ { .va = (void *)0x00000000, .pa = (void *)0x00000000, .size = 0x40000000, .access = ALT_MMU_AP_FULL_ACCESS, .attributes = ALT_MMU_ATTR_DEVICE_NS, // ALT_MMU_ATTR_WBA causes SD card fail at reading, why?? .shareable = ALT_MMU_TTB_S_NON_SHAREABLE, .execute = ALT_MMU_TTB_XN_DISABLE, .security = ALT_MMU_TTB_NS_SECURE }, /* Device area: Everything else */ { .va = (void *)0x40000000, .pa = (void *)0x40000000, .size = 0xc0000000, .access = ALT_MMU_AP_FULL_ACCESS, .attributes = ALT_MMU_ATTR_DEVICE_NS, .shareable = ALT_MMU_TTB_S_NON_SHAREABLE, .execute = ALT_MMU_TTB_XN_ENABLE, .security = ALT_MMU_TTB_NS_SECURE } }; alt_mmu_init(); alt_mmu_va_space_storage_required(regions, sizeof(regions)/sizeof(regions)); alt_mmu_va_space_create(&ttb1, regions, sizeof(regions)/sizeof(regions), alt_pt_alloc, alt_pt_storage); alt_mmu_va_space_enable(ttb1); } void init_mmc(void) { ALT_STATUS_CODE status = ALT_E_SUCCESS; ALT_SDMMC_CARD_MISC_t card_misc_cfg; print_debug("MMC Initialization.\n"); alt_globaltmr_int_is_enabled(); alt_sdmmc_init(); alt_sdmmc_card_pwr_on(); alt_sdmmc_card_identify(&Card_Info); // Card_Info.card_type == ALT_SDMMC_CARD_TYPE_SDHC alt_sdmmc_card_bus_width_set(&Card_Info, ALT_SDMMC_BUS_WIDTH_4); alt_sdmmc_fifo_param_set((ALT_SDMMC_FIFO_NUM_ENTRIES >> 3) - 1, (ALT_SDMMC_FIFO_NUM_ENTRIES >> 3), ALT_SDMMC_MULT_TRANS_TXMSIZE1); alt_sdmmc_card_misc_get(&card_misc_cfg); alt_sdmmc_dma_enable(); alt_sdmmc_card_speed_set(&Card_Info, (Card_Info.high_speed ? 2 : 1) * Card_Info.xfer_speed); // switch to high speed }  

What can I do to improve sdcard reading performance? (windows reads 13 times faster) 

 

Thanks.
0 Kudos
0 Replies
Reply