espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
446 stars 151 forks source link

I flashed the zigbee_gateway example to the ESP32, but it keeps restarting during operation. #328

Closed yiwang103 closed 1 week ago

yiwang103 commented 3 weeks ago

Answers checklist.

IDF / ESP32-Arduino version.

ESP-IDF v5.3

Operating System used.

Linux

How did you build your project?

Command line with idf.py

Development Kit.

esp32

What is the expected behavior?

can running success.

What is the actual behavior?

It keeps restarting.

Steps to reproduce.

  1. Step
  2. Step
  3. Step ... in examples/zigbee_gateway use "idf.py build" then flash to esp32 Power-on start Then I checked the logs and found that it keeps restarting.

Debug Logs.

[2024-08-21 10:20:33.860]
RX:W(2934) OPENTHREAD:[W] P-SpinelDrive-: Wait for response timeout
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x12 (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:0x3fff0030,len:7176
load:0x40078000,len:15648
load:0x40080400,len:4
ho 8 tail 4 room 4
load:0x40080404,len:3904
entry 0x40080640
I (31) boot: ESP-IDF v5.3 2nd stage bootloader
I (31) boot: compile time Aug 21 2024 08:45:36
I (31) boot: Multicore bootloader
I (35) boot: chip revision: v3.1
I (39) boot.esp32: SPI Speed      : 40MHz
I (44) boot.esp32: SPI Mode       : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label            Usage          Type ST Offset   Length
I (69) boot:  0 sec_cert         unknown          3f 06 0000d000 00003000
I (76) boot:  1 nvs              WiFi data        01 02 00010000 00006000
I (84) boot:  2 otadata          OTA data         01 00 00016000 00002000
I (91) boot:  3 phy_init         RF data          01 01 00018000 00001000
I (99) boot:  4 fctry            WiFi data        01 02 00019000 00006000
I (106) boot:  5 factory          factory app      00 00 00020000 00200000
I (114) boot:  6 zb_storage       Unknown data     01 81 00220000 00004000
I (121) boot:  7 zb_fct           Unknown data     01 81 00224000 00000400
I (129) boot:  8 rcp_fw           Unknown data     01 82 00225000 000a0000
I (136) boot: End of partition table
I (141) boot: Defaulting to factory image
I (145) esp_image: segment 0: paddr=00020020 vaddr=3f400020 size=529e4h (338404) map
I (270) esp_image: segment 1: paddr=00072a0c vaddr=3ffbdb60 size=05c6ch ( 23660) load
I (279) esp_image: segment 2: paddr=00078680 vaddr=40080000 size=07998h ( 31128) load
I (291) esp_image: segment 3: paddr=00080020 vaddr=400d0020 size=1245b0h (1197488) map

[2024-08-21 10:20:34.507]
RX:I (702) esp_image: segment 4: paddr=001a45d8 vaddr=40087998 size=161c0h ( 90560) load
I (753) boot: Loaded app from partition at offset 0x20000
I (753) boot: Disabling RNG early entropy source...
I (764) cpu_start: Multicore app
I (773) cpu_start: Pro cpu start user code
I (773) cpu_start: cpu freq: 160000000 Hz
I (773) app_init: Application information:
I (776) app_init: Project name:     zigbee_gateway
I (781) app_init: App version:      1.0
I (786) app_init: Compile time:     Aug 21 2024 08:45:27
I (792) app_init: ELF file SHA256:  d56caf346...
I (797) app_init: ESP-IDF:          v5.3
I (802) efuse_init: Min chip rev:     v0.0
I (807) efuse_init: Max chip rev:     v3.99 
I (811) efuse_init: Chip rev:         v3.1
I (817) heap_init: Initializing. RAM available for dynamic allocation:
I (824) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (830) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (836) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (842) heap_init: At 3FFCF840 len 000107C0 (65 KiB): DRAM
I (848) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (854) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (861) heap_init: At 4009DB58 len 000024A8 (9 KiB): IRAM
I (868) spi_flash: detected chip: gd
I (871) spi_flash: flash io: dio
W (875) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (889) coexist: coex firmware version: dab85ae96
I (894) main_task: Started on CPU0
I (904) main_task: Calling app_main()
I (914) ESP_RADIO_SPINEL: spinel UART interface initialization completed
I (914) ESP_RADIO_SPINEL: Spinel UART interface has been successfully enabled
I (924) ZB_ESP_SPINEL: Spinel UART interface enable successfully
I (924) main_task: Returned from app_main()

[2024-08-21 10:20:36.806]
RX:W(2934) OPENTHREAD:[W] P-SpinelDrive-: Wait for response timeout
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x12 (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:0x3fff0030,len:7176
load:0x40078000,len:15648
load:0x40080400,len:4
ho 8 tail 4 room 4
load:0x40080404,len:3904
entry 0x40080640
I (31) boot: ESP-IDF v5.3 2nd stage bootloader
I (31) boot: compile time Aug 21 2024 08:45:36
I (31) boot: Multicore bootloader
I (35) boot: chip revision: v3.1
I (39) boot.esp32: SPI Speed      : 40MHz
I (44) boot.esp32: SPI Mode       : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label            Usage          Type ST Offset   Length
I (69) boot:  0 sec_cert         unknown          3f 06 0000d000 00003000
I (76) boot:  1 nvs              WiFi data        01 02 00010000 00006000
I (84) boot:  2 otadata          OTA data         01 00 00016000 00002000
I (91) boot:  3 phy_init         RF data          01 01 00018000 00001000
I (99) boot:  4 fctry            WiFi data        01 02 00019000 00006000
I (106) boot:  5 factory          factory app      00 00 00020000 00200000
I (114) boot:  6 zb_storage       Unknown data     01 81 00220000 00004000
I (121) boot:  7 zb_fct           Unknown data     01 81 00224000 00000400
I (129) boot:  8 rcp_fw           Unknown data     01 82 00225000 000a0000
I (136) boot: End of partition table
I (141) boot: Defaulting to factory image
I (145) esp_image: segment 0: paddr=00020020 vaddr=3f400020 size=529e4h (338404) map
I (270) esp_image: segment 1: paddr=00072a0c vaddr=3ffbdb60 size=05c6ch ( 23660) load
I (279) esp_image: segment 2: paddr=00078680 vaddr=40080000 size=07998h ( 31128) load
I (291) esp_image: segment 3: paddr=00080020 vaddr=400d0020 size=1245b0h (1197488) map

[2024-08-21 10:20:37.462]
RX:I (702) esp_image: segment 4: paddr=001a45d8 vaddr=40087998 size=161c0h ( 90560) load
I (753) boot: Loaded app from partition at offset 0x20000
I (753) boot: Disabling RNG early entropy source...
I (764) cpu_start: Multicore app
I (773) cpu_start: Pro cpu start user code
I (773) cpu_start: cpu freq: 160000000 Hz
I (773) app_init: Application information:
I (776) app_init: Project name:     zigbee_gateway
I (781) app_init: App version:      1.0
I (786) app_init: Compile time:     Aug 21 2024 08:45:27
I (792) app_init: ELF file SHA256:  d56caf346...
I (797) app_init: ESP-IDF:          v5.3
I (802) efuse_init: Min chip rev:     v0.0
I (807) efuse_init: Max chip rev:     v3.99 
I (811) efuse_init: Chip rev:         v3.1
I (817) heap_init: Initializing. RAM available for dynamic allocation:
I (824) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (830) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (836) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (842) heap_init: At 3FFCF840 len 000107C0 (65 KiB): DRAM
I (848) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (854) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (861) heap_init: At 4009DB58 len 000024A8 (9 KiB): IRAM
I (868) spi_flash: detected chip: gd
I (871) spi_flash: flash io: dio
W (875) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (889) coexist: coex firmware version: dab85ae96
I (894) main_task: Started on CPU0
I (904) main_task: Calling app_main()
I (914) ESP_RADIO_SPINEL: spinel UART interface initialization completed
I (914) ESP_RADIO_SPINEL: Spinel UART interface has been successfully enabled
I (924) ZB_ESP_SPINEL: Spinel UART interface enable successfully
I (924) main_task: Returned from app_main()

[2024-08-21 10:20:39.743]
RX:W(2934) OPENTHREAD:[W] P-SpinelDrive-: Wait for response timeout
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x12 (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:0x3fff0030,len:7176
load:0x40078000,len:15648
load:0x40080400,len:4
ho 8 tail 4 room 4
load:0x40080404,len:3904
entry 0x40080640
I (31) boot: ESP-IDF v5.3 2nd stage bootloader
I (31) boot: compile time Aug 21 2024 08:45:36
I (31) boot: Multicore bootloader
I (35) boot: chip revision: v3.1
I (39) boot.esp32: SPI Speed      : 40MHz
I (44) boot.esp32: SPI Mode       : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label            Usage          Type ST Offset   Length
I (69) boot:  0 sec_cert         unknown          3f 06 0000d000 00003000
I (76) boot:  1 nvs              WiFi data        01 02 00010000 00006000
I (84) boot:  2 otadata          OTA data         01 00 00016000 00002000
I (91) boot:  3 phy_init         RF data          01 01 00018000 00001000
I (99) boot:  4 fctry            WiFi data        01 02 00019000 00006000
I (106) boot:  5 factory          factory app      00 00 00020000 00200000
I (114) boot:  6 zb_storage       Unknown data     01 81 00220000 00004000
I (121) boot:  7 zb_fct           Unknown data     01 81 00224000 00000400
I (129) boot:  8 rcp_fw           Unknown data     01 82 00225000 000a0000
I (136) boot: End of partition table
I (141) boot: Defaulting to factory image
I (145) esp_image: segment 0: paddr=00020020 vaddr=3f400020 size=529e4h (338404) map
I (270) esp_image: segment 1: paddr=00072a0c vaddr=3ffbdb60 size=05c6ch ( 23660) load
I (279) esp_image: segment 2: paddr=00078680 vaddr=40080000 size=07998h ( 31128) load
I (291) esp_image: segment 3: paddr=00080020 vaddr=400d0020 size=1245b0h (1197488) map

[2024-08-21 10:20:40.398]
RX:I (702) esp_image: segment 4: paddr=001a45d8 vaddr=40087998 size=161c0h ( 90560) load
I (753) boot: Loaded app from partition at offset 0x20000
I (753) boot: Disabling RNG early entropy source...
I (764) cpu_start: Multicore app
I (773) cpu_start: Pro cpu start user code
I (773) cpu_start: cpu freq: 160000000 Hz
I (773) app_init: Application information:
I (776) app_init: Project name:     zigbee_gateway
I (781) app_init: App version:      1.0
I (786) app_init: Compile time:     Aug 21 2024 08:45:27
I (792) app_init: ELF file SHA256:  d56caf346...
I (797) app_init: ESP-IDF:          v5.3
I (802) efuse_init: Min chip rev:     v0.0
I (807) efuse_init: Max chip rev:     v3.99 
I (811) efuse_init: Chip rev:         v3.1
I (817) heap_init: Initializing. RAM available for dynamic allocation:
I (824) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (830) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (836) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (842) heap_init: At 3FFCF840 len 000107C0 (65 KiB): DRAM
I (848) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (854) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (861) heap_init: At 4009DB58 len 000024A8 (9 KiB): IRAM
I (868) spi_flash: detected chip: gd
I (871) spi_flash: flash io: dio
W (875) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (889) coexist: coex firmware version: dab85ae96
I (894) main_task: Started on CPU0
I (904) main_task: Calling app_main()
I (914) ESP_RADIO_SPINEL: spinel UART interface initialization completed
I (914) ESP_RADIO_SPINEL: Spinel UART interface has been successfully enabled
I (924) ZB_ESP_SPINEL: Spinel UART interface enable successfully
I (924) main_task: Returned from app_main()

More Information.

No response

chshu commented 3 weeks ago

The log indicates that the RCP is not well connected to the Host SoC, could you double check your hardware setup, and the RCP firmware is flashed correctly.

You may refer to the following links: https://github.com/espressif/esp-rainmaker/tree/master/examples/zigbee_gateway#wi-fi-based-esp-zigbee-gateway https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_gateway#hardware-platforms

yiwang103 commented 3 weeks ago

日志表明 RCP 与主机 SoC 连接不良,您可以仔细检查硬件设置,并且 RCP 固件是否正确刷新。

您可以参考以下链接: https://github.com/espressif/esp-rainmaker/tree/master/examples/zigbee_gateway#wi-fi-based-esp-zigbee-gateway https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_gateway#hardware-platforms

Is this RCP mandatory? In other words, do I need an additional ESP32-H besides the ESP32

chshu commented 3 weeks ago

Is this RCP mandatory? In other words, do I need an additional ESP32-H besides the ESP32

Yes, it's mandatory, since there is no 802.15.4 (zigbee) radio in ESP32. Zigbee interface is required to build a Zigbee Gateway.

esp-zigbee-gateway-board is recommened to run the example, otherwise you need to connect two standalong SoCs manually.

yiwang103 commented 3 weeks ago

这个 RCP 是强制性的吗?换句话说,除了 ESP32 之外,我还需要额外的 ESP32-H 吗?

是的,这是强制性的,因为 ESP32 中没有 802.15.4 (zigbee) 无线电。构建 Zigbee 网关需要 Zigbee 接口。

建议使用 esp-zigbee-gateway-board来运行示例,否则您需要手动连接两个独立的 SoC。

Okay, thank you for your response. I'll give it another try once I'm ready.

shahpiyushv commented 1 week ago

Closing this since an answer has been provided.