Using SDCard in SPI mode & spi_master at the same time
Posted: Sat Dec 02, 2017 5:43 pm
It looks like spi_master and sd card in spi mode (sdpi_host) cannot be used at the same time.
I've tested combining the spi master example and sd card example and I cannot get both working.
Test configuration:
________________________
When the sdcard is mounted first, sd card is detected, card info is correct, file can be opened, read, written...
Then the display is initialized.
After that, trying to open the file fails with:
Display work with no problem.
________________________
When the display is intialized first, after the initialization the first display test works as expected, display is initialized and the pattern drawn.
Then the sdcard is mounted and works as expected, card info is correct, file can be opened, read, written...
After the sdcard intialization the display no longer works.
I've tested combining the spi master example and sd card example and I cannot get both working.
Test configuration:
- SDcard and display use the different pins for spi interface.
- Display uses HSPI_HOST and DMA channel 1.
- SDCard uses VSPI_HOST an DMA channel 2.
________________________
When the sdcard is mounted first, sd card is detected, card info is correct, file can be opened, read, written...
Then the display is initialized.
After that, trying to open the file fails with:
Code: Select all
E (2800) sdspi_host: sdspi_host_start_command: cmd=24 error=0x107
D (2800) sdmmc_cmd: sdmmc_req_run returned 0x107
E (2800) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x107
E (2810) diskio_sdmmc: sdmmc_write_blocks failed (263)
________________________
When the display is intialized first, after the initialization the first display test works as expected, display is initialized and the pattern drawn.
Then the sdcard is mounted and works as expected, card info is correct, file can be opened, read, written...
After the sdcard intialization the display no longer works.