AnsweredAssumed Answered

Problem to use USDHC2 with fatfs_sdcard exemple

Question asked by Lacouture Patrice on Mar 9, 2020
Latest reply on Mar 13, 2020 by jeremyzhou
Hello,
I have design a board that includes :
- a MIMXRT1064DVL6A processor,
- Memory IS42s16160j,
- 2 SD card slot (USDHC1 and USDHC2)
- JTAG,
- A led,
I am trying to test the SD card slot 1 and slot 2.
I am using "the fat" exemple to init and configure the USDHC and to do a "f_mkdir".
Test on slot 1: I succeed to init and configure USDHC1  and to create the directory "dir_1' into a SDcard from slot 1.
Test on slot 2: I have the code error = 6502 during the "f_mkdir" called. The error
appears from SD_SendInterfaceCondition function.
I modified the following functions :
- sdcardWaitCardInsert_SD2() : to take USDHC2 base address
g_sd.host.base           = MMC_HOST_BASEADDR;  
g_sd.host.sourceClock_Hz =  MMC_HOST_CLK_FREQ;
- BOARD_InitPinsSD2() : to init Pins SD2 card
- BOARD_USDHC2ClockConfiguration : to configure the USDHC2Clock.
Do you think I forgot a configuration to use USDHC2 instead of USDHC1?
Please find attached my modified code (fatfs_sdcard.c and pin_mux).
Thank you for your help.
Best Regards,
Patrice

Attachments

Outcomes