Open beniroquai opened 5 months ago
Alternatively, perhaps we could use SPI instead?
ESP32-S3 GPIO | microSD Card Slot |
---|---|
GPIO21 | CS |
D8 / A8 / Qt7 / GPIO7 | SCK |
D9 / A9 / Qt8 / GPIO8 | MISO |
D10 / A10 / Qt9 / GPIO9 | MOSI |
Any thoughts @KillerInk 😇
Some problems I identify with I2C:
Current state (I2C):
Master: (Reader) Master https://github.com/Matchboxscope/Omniscope-MultiCamViewer/blob/I2C_Test/ESP32/OmniscopeFW/I2CServer/I2CServer.ino
Slave: (Sender) https://github.com/Matchboxscope/Omniscope-MultiCamViewer/blob/I2C_Test/ESP32/OmniscopeFW/main/main.ino
How it could look like using SPI:
Seems like someone did it already: https://github.com/PowerBroker2/SerialTransfer/issues/70
SPI seems to be working. And it's really fast!
Here, I connect an ESP32 to the Xiao via the micro-sd card slot
Something's not right:
SP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4202bb22
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a38
entry 0x403c98d4
[ 109][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
PSRAM FOUND
[ 2306][D][ESP32DMASPISlave.h:112] spi_slave_task(): [ESP32DMASPISlave] spi_slave_task start
start spi slave
Original frame size: 8930
8601135
Padded frame size: 8932
8592187
initialize tx/rx buffers
execute transaction in the background
8592187
[ 2308][D][ESP32DMASPISlave.h:140] spi_slave_task(): [ESP32DMASPISlave] new transaction request received (size = 1)
Guru Meditation Error: Core 1 panic'ed (Double exception).
Core 1 register dump:
PC : 0x4037b01a PS : 0x00040136 A0 : 0x8037842f A1 : 0x3fcecef0
A2 : 0x00040136 A3 : 0x00040026 A4 : 0x00000001 A5 : 0x00000051
A6 : 0x02c95188 A7 : 0x00ffffff A8 : 0x3fcecfb0 A9 : 0x3fcea04c
A10 : 0x00000054 A11 : 0x00000001 A12 : 0x00000000 A13 : 0x00005004
A14 : 0x3fcf04d4 A15 : 0x00000001 SAR : 0x00000004 EXCCAUSE: 0x00000002
EXCVADDR: 0x3fcea04c LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xfffffff7
Backtrace: 0x4037b017:0x3fcecef0 0x4037842c:0x00000080 |<-CORRUPTED
#0 0x4037b017:0x3fcecef0 in _xt_context_save at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/xtensa_context.S:194
#1 0x4037842c:0x00000080 in lock_init_generic at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/locks.c:73
ELF file SHA256: 6126fb6d3597542a
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4202bb22
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a38
entry 0x403c98d4
[ 109][I
This I do not understand. On the Xiao it seems to be working, but anyway, the ESP reboots: https://github.com/hideakitai/ESP32DMASPI/issues/7
This is the SD card adapter pinout from the XIAO Sense:
This is the pinout of the microsd card
So we can use the following wiring to realize I2C:
From: https://forum.seeedstudio.com/t/using-sd-mmc-library-on-seeed-xiao-esp32s3-sense/271615/12
On ESP32-S3, SDMMC peripheral is connected to GPIO pins using GPIO matrix. This allows arbitrary GPIOs to be used to connect an SD card or MMC. The GPIOs can be configured with the following commands:
So we can use e.g. D8, D9 for I2C: