SD Card M52259EVB

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SD Card M52259EVB

跳至解决方案
1,700 次查看
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 项奖励
1 解答
611 次查看
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 项奖励
7 回复数
611 次查看
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 项奖励
611 次查看
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 项奖励
611 次查看
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 项奖励
611 次查看
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 项奖励
611 次查看
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 项奖励
612 次查看
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 项奖励
611 次查看
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 项奖励