STM32CubeMX : Accessing Both SDCards with SDMMC1 , SDMMC2 Simultaneously
Hello,
This is continuation of below Topic.
I have
/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fen%2Fevaluation-tools%2Fnucleo-f722ze.html
And Trying to access Two microSDCards Simultaneously . One by One (Either SDMMC1 or SDMMC2 is working fine)
https://community.st.com/0D50X00009XkWKfSAN
Below is my STM32Cube Configuration Setting



Rest all default .
/* USER CODE BEGIN 0 */FATFS myFATFS;
FIL myFILE, myFILE2 ;UINT testByte ;char myRDdata[15] ;/* USER CODE END 0 */MX_GPIO_Init();
MX_SDMMC1_SD_Init(); MX_SDMMC2_SD_Init(); MX_FATFS_Init();void MX_FATFS_Init(void)
{ /*♯♯ FatFS: Link the SD driver ♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯*/ retSD = FATFS_LinkDriver(&SD_Driver, SD_Path);/* USER CODE BEGIN Init */
/* additional user code for init */ /* USER CODE END Init */}/* USER CODE BEGIN 2 */
if(f_mount(&myFATFS,SD_Path,0) == FR_OK) { char mypath[] = {''0:OneDrive.txt\0''} ; f_open(&myFILE,mypath , FA_WRITE | FA_CREATE_ALWAYS) ; char mydata[] = {''SD Card 1 Testing \0''} ; f_write(&myFILE, mydata , sizeof(mydata),&testByte ) ; f_close(&myFILE) ;}
if(f_mount(&myFATFS,SD_Path, 1) == FR_OK) { char mypath2[] = {''1:SecondDrive.txt\0''} ; f_open(&myFILE2,mypath2 , FA_WRITE | FA_CREATE_ALWAYS) ; char mydata2[] = {''SD Card 2 Testing \ \0''} ; f_write(&myFILE2, mydata2 , sizeof(mydata2),&testByte ) ; f_close(&myFILE2) ; }With above code I can only access one microSD Card Only.
I am not able to access both micro SDCards simultaneously . By Added Drive number .
Please help me to resolve this ..
Thanks In advance .
--
Karan
null