This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sdcard detection

hello

i am working on a project using stm32f205, i am using the file system component v6.6 to
access an sdcard connected to the MCU via SDIO interface.

the sdcard reader i am using dont have card detection switch, so i have to check every time
if the card is present in the reader.

is there any function in the file system component v6.6 that let me do this process.

thanks

Parents
  • Maybe you can try to reinitialize the card in case this does not happen very often?

    int32_t drive_id = fs_ioc_get_id ("M0:");
    uint32_t arg = FS_CONTROL_MEDIA_INIT;
    
    if (fs_ioc_device_ctrl (drive_id, fsDevCtrlCodeControlMedia, &arg) == fsOK) {
      /* Memory media present */
    } else {
      /* Memory media removed */
    }
    

Reply
  • Maybe you can try to reinitialize the card in case this does not happen very often?

    int32_t drive_id = fs_ioc_get_id ("M0:");
    uint32_t arg = FS_CONTROL_MEDIA_INIT;
    
    if (fs_ioc_device_ctrl (drive_id, fsDevCtrlCodeControlMedia, &arg) == fsOK) {
      /* Memory media present */
    } else {
      /* Memory media removed */
    }
    

Children