Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
976 stars 229 forks source link

SPI error with SD Card reader attached #303

Closed t-c-o-d-e closed 4 years ago

t-c-o-d-e commented 4 years ago

Hi, I'm getting this with some Arduino generic external SD Card reader attached. It reads files with success, but no play on radio or mp3 player. Debug log shows VS1053 SPI error. SB:0000 R1:FFFF R2:FFFF.

"09:50:13.902 -> D: Starting Internet-radio running on CPU 1 at 240 MHz. Version Wed, 24 Apr 2019 08:20:00 GMT. Free memory 292080

09:50:13.902 -> D: Display type is DUMMYTFT 09:50:13.902 -> D: Partition nvs found, 20480 bytes 09:50:13.902 -> D: Read 53 keys from NVS 09:50:13.935 -> D: pin_ir set to 35 09:50:13.935 -> D: pin_enc_clk set to 12 09:50:13.935 -> D: pin_enc_dt set to 14 09:50:13.935 -> D: pin_enc_sw set to 27 09:50:13.935 -> D: pin_tft_cs set to 15 09:50:13.935 -> D: pin_tft_dc set to 2 09:50:13.935 -> D: pin_tft_scl set to 22 09:50:13.935 -> D: pin_tft_sda set to 21 09:50:13.935 -> D: pin_tft_bl set to -1 09:50:13.935 -> D: pin_tft_blx set to -1 09:50:13.935 -> D: pin_sd_cs set to 33 09:50:13.935 -> D: pin_vs_cs set to 5 09:50:13.935 -> D: pin_vs_dcs set to 32 09:50:13.935 -> D: pin_vs_dreq set to 4 09:50:13.935 -> D: pin_shutdown set to -1 09:50:13.968 -> D: pin_shutdownx set to -1 09:50:13.968 -> D: pin_spi_sck set to 18 09:50:13.968 -> D: pin_spi_miso set to 19 09:50:13.968 -> D: pin_spi_mosi set to 23 09:50:13.968 -> D: GPIO0 is HIGH 09:50:13.968 -> D: GPIO2 is LOW, probably no PULL-UP 09:50:13.968 -> D: GPIO4 is HIGH 09:50:14.001 -> D: GPIO5 is HIGH 09:50:14.001 -> D: GPIO12 is LOW, probably no PULL-UP 09:50:14.001 -> D: GPIO13 is HIGH 09:50:14.035 -> D: GPIO14 is HIGH 09:50:14.035 -> D: GPIO15 is HIGH 09:50:14.035 -> D: GPIO16 is HIGH 09:50:14.068 -> D: GPIO17 is HIGH 09:50:14.068 -> D: GPIO18 is HIGH 09:50:14.068 -> D: GPIO19 is HIGH 09:50:14.068 -> D: GPIO21 is HIGH 09:50:14.103 -> D: GPIO22 is HIGH 09:50:14.103 -> D: GPIO23 is HIGH 09:50:14.103 -> D: GPIO25 is HIGH 09:50:14.137 -> D: GPIO26 is HIGH 09:50:14.137 -> D: GPIO27 is HIGH 09:50:14.137 -> D: GPIO32 is HIGH 09:50:14.137 -> D: GPIO33 is HIGH 09:50:14.171 -> D: GPIO34 is LOW, probably no PULL-UP 09:50:14.171 -> D: GPIO35 is LOW, probably no PULL-UP 09:50:14.171 -> D: GPIO39 is LOW, probably no PULL-UP 09:50:14.171 -> D: Enable pin 35 for IR 09:50:14.204 -> D: Start display 09:50:14.373 -> D: Locate mp3 files on SD, may take a while... 09:50:24.253 -> D: 75 tracks on SD 09:50:24.321 -> D: Create list with acceptable WiFi networks 09:50:24.321 -> D: Added Guest to list of networks 09:50:24.321 -> D: End adding networks 09:50:24.491 -> D: Scan Networks 09:50:26.592 -> D: Scan completed 09:50:26.592 -> D: Number of available networks: 1 09:50:26.592 -> D: 1 - Guest Signal: -62 dBm, Encryption WPA2_PSK, Acceptable 09:50:26.659 -> D: End of list 09:50:26.659 -> D: Command: clk_dst with parameter 1
09:50:26.659 -> D: Command: clk_offset with parameter 1
09:50:26.694 -> D: Command: clk_server with parameter pool.ntp.org
09:50:26.694 -> D: Command: lstmods with parameter Wed, 24 Apr 2019 07:37:27 GMT 09:50:26.694 -> D: Command: mqqprefix with parameter none 09:50:26.694 -> D: Command: mqttbroker with parameter none 09:50:26.694 -> D: Command: mqttpasswd with parameter *** 09:50:26.694 -> D: Command: mqttport with parameter 1883 09:50:26.694 -> D: Command: mqttuser with parameter none 09:50:26.694 -> D: Command: pin_enc_clk with parameter 12
09:50:26.728 -> D: Command: pin_enc_dt with parameter 14
09:50:26.728 -> D: Command: pin_enc_sw with parameter 27
09:50:26.728 -> D: Command: pin_ir with parameter 35
09:50:26.728 -> D: Command: pin_sd_cs with parameter 33
09:50:26.728 -> D: Command: pin_tft_cs with parameter 15
09:50:26.762 -> D: Command: pin_tft_dc with parameter 2
09:50:26.762 -> D: Command: pin_tft_scl with parameter 22
09:50:26.762 -> D: Command: pin_tft_sda with parameter 21
09:50:26.762 -> D: Command: pin_vs_cs with parameter 5
09:50:26.795 -> D: Command: pin_vs_dcs with parameter 32
09:50:26.795 -> D: Command: pin_vs_dreq with parameter 4
09:50:26.795 -> D: Command: preset with parameter 1 09:50:26.795 -> D: Command: preset_00 with parameter 50.7.130.2:13014/stream
09:50:26.966 -> D: Command: toneha with parameter 0 09:50:26.966 -> D: Command: tonehf with parameter 0 09:50:26.966 -> D: Command: tonela with parameter 0 09:50:26.966 -> D: Command: tonelf with parameter 0 09:50:26.966 -> D: Command: volume with parameter 80 09:50:27.100 -> D: Slow SPI, Testing VS1053 read/write registers... 09:50:27.100 -> D: VS1053 SPI error. SB:0000 R1:FFFF R2:FFFF 09:50:27.100 -> D: VS1053 SPI error. SB:012C R1:FFFF R2:FFFF 09:50:27.100 -> D: VS1053 SPI error. SB:0258 R1:FFFF R2:FFFF 09:50:27.134 -> D: VS1053 SPI error. SB:0384 R1:FFFF R2:FFFF 09:50:27.134 -> D: VS1053 SPI error. SB:04B0 R1:FFFF R2:FFFF 09:50:27.134 -> D: VS1053 SPI error. SB:05DC R1:FFFF R2:FFFF 09:50:27.134 -> D: VS1053 SPI error. SB:0708 R1:FFFF R2:FFFF 09:50:27.167 -> D: VS1053 SPI error. SB:0834 R1:FFFF R2:FFFF 09:50:27.167 -> D: VS1053 SPI error. SB:0960 R1:FFFF R2:FFFF 09:50:27.167 -> D: VS1053 SPI error. SB:0A8C R1:FFFF R2:FFFF 09:50:27.201 -> D: VS1053 SPI error. SB:0BB8 R1:FFFF R2:FFFF 09:50:27.201 -> D: VS1053 SPI error. SB:0CE4 R1:FFFF R2:FFFF 09:50:27.201 -> D: VS1053 SPI error. SB:0E10 R1:FFFF R2:FFFF 09:50:27.236 -> D: VS1053 SPI error. SB:0F3C R1:FFFF R2:FFFF 09:50:27.236 -> D: VS1053 SPI error. SB:1068 R1:FFFF R2:FFFF 09:50:27.236 -> D: VS1053 SPI error. SB:1194 R1:FFFF R2:FFFF 09:50:27.236 -> D: VS1053 SPI error. SB:12C0 R1:FFFF R2:FFFF 09:50:27.269 -> D: VS1053 SPI error. SB:13EC R1:FFFF R2:FFFF 09:50:27.269 -> D: VS1053 SPI error. SB:1518 R1:FFFF R2:FFFF 09:50:27.269 -> D: VS1053 SPI error. SB:1644 R1:FFFF R2:FFFF 09:50:27.304 -> D: Connect to network 09:50:29.860 -> D: Connected to Guest 09:50:29.927 -> D: IP = 192.168.254.79 09:50:33.040 -> D: Start server for commands 09:50:33.040 -> D: Network found. Starting mqtt and OTA 09:50:33.040 -> D: MQTT uses prefix PF1BF713C 09:50:33.040 -> D: Init MQTT 09:50:33.040 -> D: MDNS responder started 09:50:34.053 -> D: Rotary encoder is enabled 09:50:34.053 -> D: STOP requested 09:50:34.053 -> D: (Re)connecting number 1 to MQTT none 09:50:34.053 -> D: New preset/file requested (1/0) from live.antenazagreb.hr:8000
09:50:34.053 -> D: Preset is 1 09:50:34.053 -> D: MQTT connection failed, rc=-2 09:50:34.224 -> D: Connect to new host live.antenazagreb.hr:8000
09:50:34.224 -> D: Connect to live.antenazagreb.hr on port 8000, extension / 09:50:34.259 -> D: Connected to server 09:50:34.259 -> D: nvs_get_str failed 1102 for key basicauth, keylen is 9, len is 150! 09:50:34.259 -> D: Contents: 09:50:34.259 -> D: Duration mp3loop 1 09:50:34.259 -> D: SPI semaphore not taken within 120 ticks by CPU 1, id hspec 09:50:34.294 -> D: SPI semaphore not taken within 130 ticks by CPU 1, id hspec 09:50:34.294 -> D: Switch to HEADER 09:50:34.294 -> D: Headerline: Accept-Ranges:none 09:50:34.294 -> D: Headerline: Access-Control-Allow-Origin:* 09:50:34.294 -> D: Headerline: Cache-Control:no-cache,no-store,mus 0, id hspec"

Tried couple different GPIOs for SD Card reader CS, but no luck, every time SD Card reader is hooked up getting that SPI error. Wires are as short as possible.

This SD Card reader if matters: https://www.berrybase.de/bauelemente/sensoren-module/funk-kommunikation/micro-sd-card-reader-modul-mit-spi-schnittstelle

ESP32 SPI pins (GPIOs) are shared between VS1053 board and SD Card reader module.

t-c-o-d-e commented 4 years ago

Found it here: https://github.com/Edzelf/ESP32-Radio/issues/89

Having exactly the same SD module :-/, will rewire it later.