W5500 and SD card on same SPI host
Posted: Fri May 27, 2022 6:07 am
I have a custom board which has a W5500 and SD card on the same SPI host. Pins are:
SPI Host - 2
SPI Speed - 12 MHz
SCLK - IO 18 - NO PULL-UP
MOSI - IO 23 - NO PULL-UP
MISO - IO 19 - NO PULL-UP
W5500 CS - IO 33 - PULLED UP
W5500 INT - IO 13 - PULLED UP
W5500 RST - IO 12 - PULLED DOWN
SD Card CS - IO 25 - NO PULL-UP
When only one device is enabled, it works fine - either W5550 or SD card. However, when I try using both devices, I get multiple errors. Typically I first initialize the SD card, which is successful, and then I try to initialize the W5500. It also goes fine and I get an IP address; however, then I receive multiple errors:
I've tried enabling CS pull-up on SD card, and it made no difference. I've also swapped the SD card adapter with one that provides pull-ups, again that did not make a difference. Can you give some directions where to look for the fault?
SPI Host - 2
SPI Speed - 12 MHz
SCLK - IO 18 - NO PULL-UP
MOSI - IO 23 - NO PULL-UP
MISO - IO 19 - NO PULL-UP
W5500 CS - IO 33 - PULLED UP
W5500 INT - IO 13 - PULLED UP
W5500 RST - IO 12 - PULLED DOWN
SD Card CS - IO 25 - NO PULL-UP
When only one device is enabled, it works fine - either W5550 or SD card. However, when I try using both devices, I get multiple errors. Typically I first initialize the SD card, which is successful, and then I try to initialize the W5500. It also goes fine and I get an IP address; however, then I receive multiple errors:
Code: Select all
E (71006) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (71006) w5500.mac: w5500_read(97): spi transmit failed
E (71006) w5500.mac: w5500_read_buffer(188): read RX buffer failed
E (71016) w5500.mac: emac_w5500_receive(572): read payload failed, len=65533, offset=1
E (72006) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
E (72006) diskio_sdmmc: sdmmc_read_blocks failed (263)
E (72006) diskio_sdmmc: Check status failed (0x107)
W (72006) httpd_uri: httpd_uri: uri handler execution failed
E (74636) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x108
E (74636) diskio_sdmmc: sdmmc_read_blocks failed (264)
W (74636) httpd_uri: httpd_uri: uri handler execution failed
E (82586) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (82586) w5500.mac: w5500_read(97): spi transmit failed
E (82586) w5500.mac: w5500_read_buffer(188): read RX buffer failed
E (82596) w5500.mac: emac_w5500_receive(572): read payload failed, len=65533, offset=1
E (82596) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (82606) w5500.mac: w5500_read(97): spi transmit failed
E (82616) w5500.mac: w5500_read_buffer(188): read RX buffer failed
E (82616) w5500.mac: emac_w5500_receive(572): read payload failed, len=65533, offset=1
E (82766) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x108
E (82766) diskio_sdmmc: sdmmc_read_blocks failed (264)
E (82766) spi_master: check_trans_valid(689): txdata transfer > host maximum
W (82776) httpd_uri: httpd_uri: uri handler execution failed
E (82776) w5500.mac: w5500_read(97): spi transmit failed
E (82786) w5500.mac: w5500_read_buffer(192): read RX buffer failed
E (82796) w5500.mac: emac_w5500_receive(572): read payload failed, len=8275, offset=30977