SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions about carrier boards have here!
User avatar
By Bipman
#238607
Hi

I've got the data logging board with the ESP32 processor board slotted in. I'm trying to use the SD card but am not having success. The example uses the Artemis processor and the schematic is fairly obvious as to what pins to use, however the ESP32 is not obvious. Can anyone point me in the right direction? I'm not sure if it is relevant but the errors I get are :-
Code: Select all
E (29) gpio: GPIO can only be used as input mode
E (30) gpio: gpio_set_level(226): GPIO output gpio_num error
E (30) gpio: gpio_set_level(226): GPIO output gpio_num error
E (34) gpio: gpio_set_level(226): GPIO output gpio_num error
E (538) gpio: gpio_set_level(226): GPIO output gpio_num error
E (538) gpio: gpio_set_level(226): GPIO output gpio_num error
E (1038) gpio: gpio_set_level(226): GPIO output gpio_num error
I am also using the Expressif SD library too.
On another note, why does is the upload so large compared to say the Artemis processor?

Bipman
User avatar
By TS-Russell
#238616
It worked normally for me; ensure you have SparkFun ESP32 MicroMod as the board selection and correct port

Also, try the SparkFun esp32 MicroMod -> SD(esp32) -> SD_Test sketch instead of the default espressif one

Then compare the code to the Espressif one (if needed) and adjust the pin #'s to match...or modify the sparkfun one :-D
User avatar
By Bipman
#238638
The thing is the SD card is built into the data logging board so there are no pins to connect. The demo code for the artemis processor has
Code: Select all
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>

const int chipSelect = 23; // The CS pin is DATA3 or 23 for the MicroMod Artemis Processor. Adjust for your processor if necessary.
What I can't find is what the CS pin is. I've tried pin 30 Flash SCS and 29 Data3 etc. and cannot get it to work. I keep getting things like
Code: Select all
entry 0x400805f0
E (29) gpio: gpio_set_level(226): GPIO output gpio_num error
E (29) gpio: gpio_set_level(226): GPIO output gpio_num error
E (30) gpio: gpio_set_level(226): GPIO output gpio_num error
E (533) gpio: gpio_set_level(226): GPIO output gpio_num error
E (533) gpio: gpio_set_level(226): GPIO output gpio_num error
E (1033) gpio: gpio_set_level(226): GPIO output gpio_num error
Card failed, or not present
I'm going to try the Artemis processor and see if it is actually working.

Bipman
User avatar
By Bipman
#238643
I've just tried the Artemis processor instead and tok the code for the SD from the logging board demo program as below
Code: Select all
#include <SPI.h>
#include <SD.h>

const int chipSelect = 23; // The CS pin is DATA3 or 23 for the MicroMod Artemis Processor. Adjust for your processor if necessary.



void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    while (1);
  }
  Serial.println("card initialized.");
}

void loop() {
  // put your main code here, to run repeatedly:
  while(1);
}
It didn't work and just printed the card failed message. I've also tried two different SD cards with different sizes so are there any more tests I can do on the board to check if the SD slot is OK or not? The SD slots are part of the board so you should only need the CS pin.

Bipman
User avatar
By Bipman
#238646
I've got it to initialise now by using SS as the chip select and not CS. Just need to do some more testing.

Bipman
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum