PLEASE help SD basic library not working on HTCC-AB02S

Hi,

I am trying to download a basic example of the SD library into my HTCC-AB02S and I am getting the following errors. I believe is due to the configuration of the pins of the SPI but I am really stuck. I have also tried to replace the variants folder from he GitHub to my pc but still getting the same problem. Could anyone help me? On arruino works fine.

This is the error I am getting

In file included from C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\src/utility/SdFat.h:29:0,
from C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\src/SD.h:20,
from C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\examples\CardInfo\CardInfo.ino:24:
C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\src/utility/Sd2Card.h:70:41: error: ‘SS’ was not declared in this scope
uint8_t const SD_CHIP_SELECT_PIN = SS;
^
C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\src/utility/Sd2Card.h:79:35: error: ‘MOSI’ was not declared in this scope
uint8_t const SPI_MOSI_PIN = MOSI;
^
C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\src/utility/Sd2Card.h:81:35: error: ‘MISO’ was not declared in this scope
uint8_t const SPI_MISO_PIN = MISO;
^
C:\Users\Desktop\Arduino\arduino-1.8.13\libraries\SD\src/utility/Sd2Card.h:83:34: error: ‘SCK’ was not declared in this scope
uint8_t const SPI_SCK_PIN = SCK;
^
exit status 1
Error compilando para la tarjeta CubeCell-GPS(HTCC-AB02S)

Hi,
I have the same problem. i am waiting for the response of @Supporter but they never got back to me.

@jasonXu could you help us? you help me before so you might be able to help me.

Regards,

hi,

The git version have no this compilation problem. You can try the git version:

We will fix the issue of Boards Manager version in the near future.

Hi JasonXu,

Thanks for your reply. I have tried to follow the guidelines of the github repository in two different PC and i am still getting the same errors. is there anything i could do manually? i don’t know what is failling here but I am in the same position as before.

Regards,

Do you try the git version development environment?

Hi JasonXu,

I did try on a windows Pc but it was giving me the same problem. I had a linux distribution and it seems to work overthere. Now, i have some questions which i think you might be able to help me.

As I am working on the TTN, I came with an idea of storing the values of the BMP180 on a sd card. i have seen there is two SPI connections on the HTCC-AB02s:

  1. Which SPI connection is the primary ?pines 25,26,27,28 or pines 8,9,10. Do I have to use some resistors on this pins?

  2. Can i use any pin for the Chip Select on the SPI?

  3. I have attached the code i am trying to use and i am getting connection failed.
    #include <SD.h>
    #include <SPI.h>

void setup() {
Serial.begin(9600);
Serial.print(“Starting SD …”);
if (!SD.begin(19))
{
Serial.println(“Failed to Start”);
return;
}
Serial.println(F(“Running OK”));
}

void loop() {

}

With the code above, i am always getting Failed to start. Any help will be much appreciated as i am stuck.

Regards,

%E5%9B%BE%E7%89%87



so, you have to use this format(cubecell’s format):

SD.begin(GPIOx);// GPIOx is the your CS pin

Hi JasonXu,

I have tried to follow your example but I had the same issue. I am getting error in SD.begin(1, 14, 12, 15)

const int chipSelect = 4;

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
;
}
Serial.print(“Initializing SD card…”);
pinMode(SS, OUTPUT);

if (!SD.begin(17, 14, 12, 15)) {
Serial.println(“initialization failed!”);
return;
}
Serial.println(“initialization done.”);
Serial.println(“done!”);
}

Is that what you were saying by having the SS kept as an output?
Regards,

Hi JasonXu,

Do i hve to do something with the SPIClass ? How can i use?

I have tried to use SPI.begin( SD_CS, SD_MOSI, SD_MISO, SD_CLK) but it gives me an error. Shall i I used the SD.begin or SPI.begin. Do you have any example which i can use to follow?

Thanks for your help.

Regards,

could you try this code:

#include <SD.h>
#include <SPI.h>

const int chipSelect = 4;

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
;
}
Serial.print(“Initializing SD card…”);
pinMode(SS, OUTPUT);

if (!SD.begin(SS)) {
Serial.println(“initialization failed!”);
return;
}
Serial.println(“initialization done.”);
Serial.println(“done!”);
}

void loop() {

}

BTW, could you show me the pin connect picture?

Hi JasonXu,

I have tried with the code you sent me and I just get “Initialization failed!”
About the connections

SD ----------------------- HTCC-AB02S

CS -------------------------PIN 4 (ADC3)
SCK ------------------------ PIN 27 LORA_CLK
MOSI ----------------------- PIN 25 LORA_MOSI
MISO ----------------------- PIN 26 LORA_MISO
VCC ------------------------ VCC (5V)
GND -------------------------- GND

  • The SD is not being initialize, is there anything I am missing? Are my connections right?
  • Can i use the chipSelect as 4(adc3) or it should be 11(GPIO4) ?
  • Do i have to initialize the SPI? the value of SS (!SD.begin(SS)). it is taking the value from arduino_pin.h ?

Thanks for your help.

Regards,