MKR IoT Carrier with MkrZero SD card not recognized

Hi everyone,

I try to connect a micro-SD card to MKR IoT Carrier rev2 with powered by MKRZero.
The MKRZero has a builtin micro-SD card holder on dedicated SPI (which works well with my SD car) but it is not very accessible when plugged on the carrier.

By default the SD_CS pin is D0 in Arduino_MKRIoTCarrier and it is confirmed by data sheet and schematics.

But it's not working at all when SD library is initialized. I've also tried the D4 pin which is the one free SPI SS pin on MKRZero without any success and also the 28th digital pin which is the SPI1 SS pin (the one dedicated to the MKRZero SD card holder).

Does any one which also use the MKRZero over MKRIoTCarrier rev2 or 1 succeed to use the SD card holder located on the carrier ?

Is there any specialist of these electronics which may explain me and community whether there is an incompatibility between MKRZero and MKRIoTCarrier.

Thanks for reply

the SD library will only use the SD card holder on MKR Zero.
if you want to use SD card on a shield you have to select a different MKR model in the Tools menu

Hi Juraj,

Thanks for your reply, it put me in the way of the solution.
I have redefined the four here-after constants in the file <Arduino path>/libraries/SD/src/utility/Sd2Card.h, just after inclusion of Arduino.h (which first defines the SDCARD pins for MKRZero variant):

            = #include <Arduino.h>
            + #define SDCARD_SPI      SPI
            + #define SDCARD_MISO_PIN PIN_SPI_MISO
            + #define SDCARD_MOSI_PIN PIN_SPI_MOSI
            + #define SDCARD_SCK_PIN  PIN_SPI_SCK

Hope it will help others.
The proper way to fix it should be to be able to initialize SD library with all SPI component, not only SS pin.

why not just select MKR1000 in the Tools menu?

I don't know the side effects of selecting another board.
As they are based on same chip, the program will probably execute but initialization may be done with differents values.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.