Inkplate 10 SD card initialization fails with sdCardInit()

Customer:

I recently bought an Inkplate 10 and I’m trying out all the features. Unfortunately, I cannot get the SD card to work. This is my minimal test sketch:

#include "Inkplate.h"
Inkplate display(INKPLATE_1BIT);

void setup() {
  Serial.begin(115200);
  display.begin();
  Serial.println("Trying SD Card");
  if (display.sdCardInit()) {
    Serial.println("SD Card OK");
  }
}

void loop() {}

With a new 16GB SD card inserted, I get:

Trying SD Card
SD Card error

I’ve tested with:

I also tested the examples with MicroPython. Running basicBW.py gives:

python3 pyboard.py --device /dev/ttyUSB0 "Examples/Inkplate10/basicBW.py"
Sd card could not be read
Traceback (most recent call last):
  File " ", line 9, in
  File "inkplate10.py", line 744, in begin
  File "inkplate10.py", line 65, in init
  File "mcp23017.py", line 18, in __init__
  File "mcp23017.py", line 30, in write
OSError: [Errno 19] ENODEV

I’m wondering if the SD card formatting could be the cause. Would it be possible to use the SdFormatter example from the SdFat library (version 2.2.0)?

Originally submitted via email support on 21 February 2023. Migrated to the forum for community visibility.

Soldered Support:

Please download the library from the PCAL-Support branch and extract it into your Arduino libraries folder.

The board uses a MOSFET to turn the SD card on and off to save energy when not in use. The old library doesn’t include the code to control this, which is why you’re getting the error. The newer library should resolve this.

You can format the SD card in FAT32 and it should work.

Attachment omitted in migration: image.png

Customer:

Thank you for the suggestion, but it didn’t work. I was already using a recent version of the PCAL-support branch. I’ve run additional tests to rule out other causes:

All tests produce the same error. I’m not sure what else to try. I’m reasonably comfortable with programming in general, but microcontrollers are fairly new to me. I’m willing to run more extensive tests if that would help narrow down the problem.

Attachment omitted in migration: image.png

Soldered Support:

There is another option to try. Please solder jumper JP1. This jumper is provided to bypass the MOSFET if you don’t want the SD card to be turned on and off. When the jumper is connected, the card will be always on.

You could also try running the example sketches that use the SD card from the library - they are tested and known to work.

Attachment omitted in migration: JP1.jpg

Soldered Support:

If you have a multimeter, you can test the SD card pins. Set it to continuity mode and test pins 12, 13, 14, and 15 to GND - it should not beep. If it beeps, something is wrong.

If the SD card still doesn’t work, make sure you’re using the newest library from the PCAL branch and newest board definitions, as we test all Inkplates before shipping:

https://github.com/SolderedElectronics/Inkplate-Arduino-library/tree/PCAL-Support

https://github.com/e-radionicacom/Dasduino-Board-Definitions-for-Arduino-IDE/raw/dev/package_Dasduino_Boards_index.json

For your MicroPython problem, you need to use the library that supports the PCAL GPIO expander, as the master branch version doesn’t support it.