• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Card mount failed

Q&A Forum › Category: ESP32 › Card mount failed
0 Vote Up Vote Down
Nazmie Razali asked 6 years ago

Hi, I’m using Heltec Wifi LoRa 32 as my microprocessor to do Unit 3, Module 11 (Lora receiver). I tried to mount the SD card to save the data but it said “card mount failed” . can you explain what it means? By the way, below is the pin mappings that I used.
3v3-3v3
CS-GPIO 15
MOSI- GPIO 27
CLK-GPIO 5
MISO-GPIO 19
GND-GND
SS-GPIO18
RST-GPIO14
DIO0-GPIO26
SD_CS-GPIO15
Hope to hear from you soon, thank you.

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

Hi.
Both the SX1278 (lora chip) and SD cards use SPI as communication bus. In your case, the SPI pins you are using for the SD card are being used by the LoRa chip, so you can’t initialize the SD card.

So, you need to use two SPI buses.
For example, to initialize the SD card:

#define SD_CS 23
#define SD_SCK 17
#define SD_MOSI 12
#define SD_MISO 13
SPIClass sd_spi(HSPI);
sd_spi.begin(SD_SCK, SD_MISO, SD_MOSI, SD_CS);
if (!SD.begin(SD_CS, sd_spi))
  Serial.println("SD Card: mounting failed.");
else
  Serial.println("SD Card: mounted.");

This should solve your problem.
I found these information here on GitHub: https://github.com/jonashoechst/ttgo-lora-sd you may find this information useful.
I hope this helps. Let me know if it works.
Regards,
Sara

0 Vote Up Vote Down
Nazmie Razali answered 6 years ago

Thank you for your solution. Will try it later and let you know the results.

0 Vote Up Vote Down
Nazmie Razali answered 6 years ago

Hi Sara, I’ve tried using the solution as above but  it still gave me “mounting failed” instead of “mounted”. the pin mapping I used is same as the above because TTGO and Heltec board are similar in pin mapping. So is there any solutions that you can suggest to me? 

1 Vote Up Vote Down
Nazmie Razali answered 6 years ago

No worries Sara, just checked the adapter of the SD Card and it said that it need to connect to 5V instead of 3.3V. Just changed a wire and used the code above and yes, it worked! Thank you very much 🙂

1 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

That’s great! I’m glad it works.
If you need any more help, you just need to open a new question.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.