AnsweredAssumed Answered

Problems with microSD card module and Nucleo-L432KC

Question asked by Andreozzi.Emilio on May 12, 2017
Latest reply on May 22, 2017 by ChrisH



seems that I'm having many problems using the peripherals I need for my MSc Thesis project with the Nucleo-L432KC.

Now it's time to have problems with the microSD card module.


I bought this module:

XCSOURCE 3 pezzi Micro SD SDHC Shield TF scheda di memoria Modulo 6 pin SPI per Arduino TE417: Elettronica 




I'm using the library SDFileSystem.h from SD Card File System - Cookbook | mbed and I tried the example program on my Nucleo-L432KC with these connections:


SD card module  |  Nucleo-L432KC

         CS           --->         D3 (SPI1_NSS)

         SCK        --->          A4 (SPI1_SCK)

         MOSI      --->          A6 (SPI1_MOSI)

         MISO      --->          A5 (SPI1_MISO)

         VCC        --->         +3v3

         GND       --->          GND




I'm using this 8GB SDHC card formatted as FAT32.


I got the error message "Could not open file for write".


I also tried other connections, using

  • {D2 (SPI1_MOSI), D10 (SPI1_MISO), A4 (SPI1_SCK), D3 (SPI1_NSS)}
  • {D11 (SPI3_MOSI), D12 (SPI3_MISO), D13 (SPI3_SCK), A3 (SPI3_NSS)}


but I continue getting the same error message.


I tried to create in the SD card the directory and file .txt, used in the example program, before running the program, but it didn't work.


I don't have any other ideas to face and solve this problem, so I would appreciate any kind of help, because I'm going crazy with it!


Thank you all in advance and have a good day!