SD Card SPI + MFS?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,156件の閲覧回数
EDesigns
Contributor I

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)

0 件の賞賛
返信
1 解決策
1,760件の閲覧回数
PetrM
Senior Contributor I

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

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
1,760件の閲覧回数
PetrL
NXP Employee
NXP Employee

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

0 件の賞賛
返信
1,760件の閲覧回数
EDesigns
Contributor I

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: ?

0 件の賞賛
返信
1,761件の閲覧回数
PetrM
Senior Contributor I

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

0 件の賞賛
返信
1,760件の閲覧回数
EDesigns
Contributor I

Thank you PetrM! I was able to port it over rather easily and succesfully!

0 件の賞賛
返信
1,760件の閲覧回数
EDesigns
Contributor I

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.

0 件の賞賛
返信