Espressif ESP32C3 SD implementation

Feedback from Espressif github was that the ESP32 library for the FAT uses the Posix & standard C libraries, as such the

The FAT_TIME & FAT_DATE are specific to the non-ESP32 libraries. Examples which use the dateTimeCallback will thus fail to compile.

I’ll try settimeofday tomorrow. Still jet lagging…

Lot’s of reasons for selecting the XIAO SAMD21 M0 board.

No need for the Wifi or BLE implementation, lower speed and as seen with the ESP32 libraries - more libraries - fewer conflicts provided you don’t need the wireless communication or higher CPU speeds.

It’s also much easier to solder directly onto a board as a “part” e.g. no parts or chips underneath.

I’ve used them as a programmable controller in power supply blocks.

I also use them on test jigs for other boards that I’m working on… need for wifi or a BLE implementation on a test jig controller.

That library works, but it causes conflicts with other non-Espressif libraries.

Issue is that many of the ESP32 board makers like Adafruit, Sparkfun and Seeed, use the Espressif ESP32 board library - which replaces the SD libraries and a few other libraries with there own. Espressif uses the Posix and standard C libraries which can then cause conflicts with other procedures if you happened to not know.

The only way you find out is by either posting in a forum — or digging deep into the Espressif code, (e.g. following the included libraries).

It would be easier if they examples explain that up front.

It also means that portability across all the Xiao family may require code changes anytime an ESP32 is used.

dude what are you talking about?

The examples and the Serial output shows it does work correctly… no errors correct time and dates.

Well I’m sad to say but you are incorrect. They do compile and they do work with an ESP32C3 they provide the right Time and date stamps if you do the time right first off.
All the other stuff you speaking to is more of a personal want than an issue with the code, or library. You will never find an SD library that’s universal if that’s what your getting at, I have no clue and don’t really care other than I can get it to work fine. Since you don’t , can’t or won’t share the code you :index_pointing_at_the_viewer: are have an issue with. pretty much the end of it. You asked I tested and I confirm it works, anything else without skin in the game is fodder for the mill.
HTH
GL :slight_smile: PJ

The espressif examples work. no need to dig anything. You make a lot of statements but don’t provide the empirical data or code to back that up? I use them with other hardware devices like IMU, I2S , NimBLE , E-ink display’s and many more. You may find it beneficial to spend some time on going thru the basic examples they provide in the IDE and on their GIT to get familiar with the more advanced, feature rich MCU’s , the Sam21D is the entry level unit. Check out the Nrf52840 sense way, way better.
unless blinking leds and doing some light A to D or PWM’g a stip of RGB’s

LOL , Never has never will be if they Grow and evolve as new Hardware comes out.
It’s why everyone also has there own SDK’s too. Did you just discover this, because it’s been that way from the jump.
(what he is saying) or
What you mean is , and showing some years.
That Also in 2010 (old) ANSI C and ISO C are standards for the syntax and behavior of the C programming language, while POSIX is a standard for the libraries used to access common operating system functions . These standards help with portability and allow for the use of common functions across different systems. not these MCU’s , I see with coders who use “strings:”
but that’s another discussion. At CMU, SEI we always had to be Posix compliant with some stuff, but the ADA stuff MIL-Spec was even more stringent REST. (Realtime Embedded System Test) projects.
I suggest you continue to use more powerful MCU’s and stretch your skill level via testing and building with more espressif devices.
:v:

Did you take the time to actually look at the library source code from Espressif (ESP32) and the Arduino libraries for the SD code that predates the ESP32?

The original non-Espressif libraries defined the FAT structure in the file system libraries. Espressif in the ESP32 simply includes the Posix libraries - which then causes conflicts with some of the prior Arduino libraries that people use.

For example the Adafruit library for the PCA955x ( I2C multiplexer) and the SD libraries from Espressif - result in compile time errors because of C library function collisions / template errors.

Why push for the more powerful single source processor? If you don’t need it.

I chose the XIAO board pinout because there are multiple vendors… and literally it would be possible to create a TI DSP or STM chipset that fits on the same board. Not tied only to Espressif.

Ok let’s see one? LOL c’mon MAN!!! (espn)
Bro , your getting way in the weeds with this, i.e left field. NO One is going to go
back to the dinosaur ages and dig up bones, The stuff works. Move on.
I got better things to actually work on… and sure you will find stuff that’s old and new that won’t compile or work together. What’s the point? WE all LOVE the Xiao Form factor it’s why we are here and not on SParkfn, dafruit, or drobot. you get what I’m sending? maybe you should go post on espressif forum sounds like the beef or confusion is with them.
GL :slight_smile: PJ
:v:

Try the Seeed XIAO or Adafruit implementation with the RP2040.

I’ve boards that are designed to allow any of the XIAO foot print boards from the M0 to the ESP32C6 to drop in place electrically.

Only the ESP32 family was developed with their specific libraries.

1 Like

You use a GPS attached to the Xiao M0 (SAMD21) to set the time, if needed. I’ve done that many times for small off network data logging.

you can also use a network time server if you use the XIAO ESP32C3 or other WiFi enabled