I'm using a Lolin D32 Pro with its inbuilt SDCard and native TFT display connector and esp-idf v3.2-dev-209-gbe81d2c1... well trying to
Lolin/Wemos have designed the board with the SD Card and TFT sharing the same SPI bus with a different CS line (4 & 14 respectively) for each. I wonder if this was a huge mistake.
I spent ages getting the display to work with esp-idf, was delighted when I did... and then hit the buffers when I discovered that it breaks writing to the SDCard that was previously working.
Code: Select all
3 16831970 CAN receive 291 (0x123) Length: 8 Data: 1122334455667783
E (22898) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x107
E (22899) diskio_sdmmc: sdmmc_write_blocks failed (263)
4 21843290 CAN receive 291 (0x123) Length: 8 Data: 1122334455667783
E (27911) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x107
E (27919) diskio_sdmmc: sdmmc_write_blocks failed (263)
5 26867201 CAN receive 291 (0x123) Length: 8 Data: 1122334455667783
E (27933) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x107
After some Googling I found a comment in the docs (https://dl.espressif.com/doc/esp-idf/la ... sdmmc.html):
Oh dear..... this seems to imply that the features of the Lolin D32 Pro board are not useable with esp-idf without some magic (or an update of esp-idf to some as-yet-unwritten version).Currently SD SPI driver assumes that it can use the SPI controller exclusively, so applications which need to share SPI bus between SD cards and other peripherals need to make sure that SD card and other devices are not used at the same time from different tasks.
Can anyone suggest how one could construct some suitable magic? Would putting a semaphore around my
Code: Select all
fprintf(log_fp,"......
fflush(log_fp);
fsync(fileno(log_fp));
Any other ideas?
Does the Arduino IDE ESP32 stuff also suffer from the same problem? I'm loath to jump there from esp-idf but if that means my Lolin hardware will work I guess I'll have to consider it.
TIA