I have a project that is gets data from BLE advertisements every few seconds and then periodically will upload this data to a mysql database with a POST request.
I have 2 x esp32s3-zeros and 2 sd card modules.
Here's a quick outline. The 2 esp32's (ESP A and ESP B) are both connected to the same SD cards (SD#1 and SD#2). ESP A saves data from non-connectable BLE advertisements to SD#1 and then every 10 minutes switches from saving data on SD#1 to SD#2, a signal is sent via GPIO to ESP B that this switch has happened - and ESP B then access SD#1 and uploads the saved data using POST request (I have a SIM7600 modem connected to ESP B for this).
The hope is for data from BLE advertisements to be continuously saved to one of the two SD cards by ESP A. The card that isn't being used for saving is then the source for the data to be uploaded by ESP B.
Is this possible - in theory I think it is but I am having issues with SD card initialization when there both ESP's are in the circuit - even if ESP B is not powered.
Here's how the SD cards are wired:
ESPA ESPB
GPIO 9 -> MISO SD1 and SD2 GPIO 9 -> MISO SD1 and SD2
GPIO 10 -> MOSI SD1 and SD2 GPIO 10 -> MOSI SD1 and SD2
GPIO 11 -> SCK SD1 and SD2 GPIO 11 -> SCL SD1 and SD2
GPIO 5 -> CS SD1 GPIO 5 -> CS SD2
GPIO 6 -> CS SD2 GPIO 6 -> CS SD1
3.3V Shared
GND Shared
GPIO 12 ESPA signal pin -> GPIO12 ESPB signal pin
I have 10k pull-up resistors on ESP B CS pins to keep HIGH by default.
Does anyone know if this can actually be done in practice or is there a better way to do this. I am not using FreeRTOS - I've no experience of this. I am trying to use one SPI Bus to save on GPIO pins.
Thanks for any help.