SD Card M52259EVB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SD Card M52259EVB

Jump to solution
1,645 Views
EDesigns
Contributor I

Am I able to use the SD Card drivers/examples that come with MQX 3.6 with the M52259EVB evaluation board?

 

The examples do not come with any pre-built code for either M52259DEMO or M52259EVB board.

0 Kudos
1 Solution
556 Views
PetrM
Senior Contributor I

Hello,

 

well, there are some known issues listed in Release notes and it's planned to introduce a thread on this forum related to issues/workarounds. For now, please take a look here for the QSPI CS issue:

 

https://community.freescale.com/thread/63312

 

Sorry for confusion on sdcard initialization.

_io_sdcard_spi_init() function takes pointer to opened SDCARD file descriptor.

So in your case:

  • introduce flash_spi subdirectory based on sdcard_spi
  • rewrite there init, read, write functions (you won't need the crc and communicate function - just have to format and read/write packets to spi flash)
  • install the sdcard driver as shown in mfs_sdcard example with _bsp_sdcard0_init structure holding pointers to your init/read/write functions.

 

PetrM

 

View solution in original post

0 Kudos
7 Replies
556 Views
EDesigns
Contributor I

I was able to get the SD card working. The M52259EVB evaluation board and the MCF52259 do not have internal pull-up resistors which I did not realize.

0 Kudos
556 Views
DavidS
NXP Employee
NXP Employee

Hi EDesign,

Currently the only SD Card example is with our twrmcf52259 Tower setup that has an additional Tower Memory card added that has the SD Card slot.

The m52259evb does not have SD Card slot but does have Compact Flash interface.  That is supported via the PCFlash settings.

Regards,

David

0 Kudos
556 Views
EDesigns
Contributor I

Thank you David for the reply.

 

For anybody that has been able to get the SD card to work using QSPI, could you post example code for initialization? I am able to put the SD card into its "idle mode" state, but when I send commands "55" and "41", it is returning the wrong responses. I've successfully initialized an SD card before on a different microcontroller, but I'm not sure what I am doing wrong with the M52259EVB.

0 Kudos
556 Views
PetrM
Senior Contributor I

Hello,

 

there's an issue regarding QSPI CS assertion - when you try to access multiple SPI devices at the same time. The workaround is to use manual GPIO CS callbacks.

The other thing is correct setting of SPI and the initialization procedure itself - please refer to sdcard_spi.c, everything is there.

 

PetrM

 

0 Kudos
556 Views
EDesigns
Contributor I

PetrM,

 

I've been trying to get the sdcard_spi.c code to work with my eval board the past 2 days with no luck. For the following initialization function:

_io_sdcard_spi_init (MQX_FILE_PTR fd_ptr)

 

What exactly is fd_ptr refering to? Initially I thought it points to the QSPI, but MQX crashes at runtime with that.

0 Kudos
557 Views
PetrM
Senior Contributor I

Hello,

 

well, there are some known issues listed in Release notes and it's planned to introduce a thread on this forum related to issues/workarounds. For now, please take a look here for the QSPI CS issue:

 

https://community.freescale.com/thread/63312

 

Sorry for confusion on sdcard initialization.

_io_sdcard_spi_init() function takes pointer to opened SDCARD file descriptor.

So in your case:

  • introduce flash_spi subdirectory based on sdcard_spi
  • rewrite there init, read, write functions (you won't need the crc and communicate function - just have to format and read/write packets to spi flash)
  • install the sdcard driver as shown in mfs_sdcard example with _bsp_sdcard0_init structure holding pointers to your init/read/write functions.

 

PetrM

 

0 Kudos
556 Views
accutime
Contributor III

Hi PetrM

 

Can you please explain the problems regarding multiple SPI CS assertion ??

 

Is there a errata  that lists on going MQX problems and work arounds ?

 

Kind Regards

 

Paul H

0 Kudos