Hello,
I'm using the M52259EVB evaluation board and am successfully initializing a microSDHC card with SPI.
Is it possible to use the MFS driver to read the FAT32 file system contents of the SD card?
I'm trying to open the device that I will be installing the MFS onto but it keeps crashing when i call
fopen("spi0:", 0)
Solved! Go to Solution.
Hello,
you need to have a look at BSP of one of the boards, that already supports SDCARD driver, like twrmcf52259 (same processor). There are several files/declarations/initializations that need to be added to m52259evb's BSP - sdcard/sdcard_spi driver, init_sdcard0.c etc.
PetrM
Hi,
the code is crashing because you spi driver is not prepared cooperate with MFS directly. However you can use SD card driver for this task.
See SDCARD example in "C:\Program Files\Freescale\Freescale MQX 3.6\mfs\examples\sdcard" and SD card documentation in IO Guide "C:\Program Files\Freescale\Freescale MQX 3.6\doc\mqx\MQXIOUG.pdf" .
If you port the example to your system you should be able to access FAT32 on SD card.
Regards,
Petr
I've attempted to port the code over and I'm still encountering the same problem as I was before.
It keeps crashing on this line:
sdcard_handle = fopen("sdcard:", 0);
I'm kind of confused on where sdcard: is coming from. Should it be spi0: ?
Hello,
you need to have a look at BSP of one of the boards, that already supports SDCARD driver, like twrmcf52259 (same processor). There are several files/declarations/initializations that need to be added to m52259evb's BSP - sdcard/sdcard_spi driver, init_sdcard0.c etc.
PetrM
Thank you PetrM! I was able to port it over rather easily and succesfully!
PetrL,
Thank you for your response. I did look at those SDCard examples and the section in the I/O user guide. However, the SD Card drivers are not compatible with the 52259EVB evaluation board.
I am having troubles porting it over because the _io_sdcard_install function uses _io_dev_install_ext which uses the SD card functions that are not SPI.