PaxInstruments / PaxInstruments-LabWiz-firmware

Firmware for the Pax Instruments LabWiz board.
0 stars 1 forks source link

SD card returning error #18

Open charlespax opened 8 years ago

charlespax commented 8 years ago

We're able to read/write to SD cards, but there are some problems.

The 256 MB cards that ship with the T400 have worked flawlessly in the T400. However, they do not work at all in the labWiz. The T400 operates the SD card in SPI mode while LabWiz uses 1-bit SD mode. There could be something happening with the initialization. A doc online states, "To switch the card to SPI mode, the CS signal must be asserted while the host issues a reset command to the card. " The SPI mode CS pin is not connected, so it is floating. Maybe we need to add a pullup/pulldown resistor to made sure the CS pin is not being asserted. Is a RESET command currently being sent to the SD card on startup? screen shot 2017-01-31 at 17 32 35

charlespax commented 8 years ago

Note that the pin connections for SPI mode and 1-bit SD mode are different. screen shot 2016-08-22 at 19 45 09

See also https://github.com/PaxInstruments/labwiz-board/issues/24

protological commented 7 years ago

A deep dive should be done in the SD card "HAL" provided by ST. There is a drv_filesystem source file that should wrap all the functions of the SD card, so the developer just needs to call open() write(), close(), etc. Also check around line 340 of labwiz_entry.c for a note on the SD card init. The init function checks for the presence of an SD card.