ESP32 reboots when enable SPI

alexander
Posts: 5
Joined: Wed Oct 24, 2018 2:54 pm

ESP32 reboots when enable SPI

Postby alexander » Wed Oct 24, 2018 3:11 pm

While developing firmware we stumbled upon very strange behaviour.

We have ESP32-WROVER with SPI chip MCP23S09 connected to it.
But after trying to initialize SPI, ESP32 reboots.
Interesting thing is that if we use ESP32-WROOM, then this problem does not happen.

Here is sample application (can use default makefile, default sdkconfig):
app_main.c
(1.93 KiB) Downloaded 888 times

Code: Select all

I (0) cpu_start: App cpu up.
I (230) heap_init: Initializing. RAM available for dynamic allocation:
I (236) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (242) heap_init: At 3FFB3378 len 0002CC88 (179 KiB): DRAM
I (249) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (255) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (261) heap_init: At 40089618 len 000169E8 (90 KiB): IRAM
I (268) cpu_start: Pro cpu start user code
I (286) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (287) test: before spi_bus_initialize
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5804
load:0x40078000,len:9020
ho 0 tail 12 room 4
load:0x40080000,len:6064
So it means that after call to spi_bus_initialize device reboots.

What should I do to fix this problem?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 reboots when enable SPI

Postby ESP_Sprite » Thu Oct 25, 2018 2:43 am

Hmm, I just flashed your app to an esp32-wrover-kit board (which has a wrover module on it) and I get no issues at all, the code just runs and keeps running. First thing that comes to mind: perhaps your board has a short between the lines you use for the SPI bus, and e.g. the enable line, or perhaps a flash line or something?

alexander
Posts: 5
Joined: Wed Oct 24, 2018 2:54 pm

Re: ESP32 reboots when enable SPI

Postby alexander » Thu Oct 25, 2018 10:11 am

I'm quite confident that we don't have shorts between SPI lines.

Is it possible that some pin states during boot affects future behaviour?
Or maybe some pins are left floating and it somehow affects it as well?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 reboots when enable SPI

Postby WiFive » Thu Oct 25, 2018 11:34 am

The fact that it is a clean POWERON_RESET with no crash seems like enable pin or supply voltage issue.

alexander
Posts: 5
Joined: Wed Oct 24, 2018 2:54 pm

Re: ESP32 reboots when enable SPI

Postby alexander » Fri Oct 26, 2018 10:20 am

Dev board is powered with USB cable from port on good computer.
So, it really shouldn't be the power issue.

And there is still question why it happens with wrover, but not happens with wroom.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 reboots when enable SPI

Postby WiFive » Sat Oct 27, 2018 1:22 am

Did you test multiple units? How were the modules soldered? What does pcb layout and schematic look like? Did you put a scope on enable pin?

Who is online

Users browsing this forum: No registered users and 21 guests