AnsweredAssumed Answered

Error opening filesystem:

Question asked by HAOYUAN CAI on Aug 18, 2015
Latest reply on Aug 19, 2015 by HAOYUAN CAI

Dear all:

 

I have a problem when I use SD card. I attached my code before. I found the return value is error when I use fopen = ("a:",NULL); the return value is 0x000000.

 

I dont know why?

 

void main(void)

{

     (void)          temp; /* suppress 'unused variable' warning */

      boolean            inserted = TRUE, readonly = FALSE, last = FALSE;

    _mqx_int        error_code;

    _mqx_uint       param;

    MQX_FILE_PTR    com_handle, sdcard_handle, filesystem_handle, partition_handle;

    char            filesystem_name[] = "MFS:";

    char            partman_name[] = "pm:";

    char            partition_name[] = "pm:1";

com_handle = fopen(BSP_SDCARD_ESDHC_CHANNEL, (void *)(SPI_FLAG_FULL_DUPLEX));

 

error_code = _io_sdcard_install("sdcard:", (void *)&_bsp_sdcard0_init, com_handle);

 

sdcard_handle = fopen("sdcard:", 0);

       /* Install MFS over SD card driver */

error_code = _io_mfs_install(sdcard_handle, filesystem_name,0);

(The return value is all correct above)

 

 

filesystem_handle = fopen(filesystem_name, NULL);  (filesystem_handle  is equal to 0x00000000) and mention "Error open filesystemname" But I think I can open the sdcard device. Therefore, there is not problem in hardware? right ?

error_code = ferror(filesystem_handle);

 

}

 

Any one can help me .thankyou

Outcomes