-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sleepy_end_device example crashes (TZ-404) #148
Comments
+1 |
Hello @blastrock @Bosemani , The ESP32C6 currently does not support the sleep mode, but support is anticipated within this month. Any updates regarding the support will be communicated to you. In the meantime, kindly consider using the ESP32H2 as an alternative. |
Hai @xieqinan Still I'm facing this issue. Here is the Log ELF file SHA256: bc4e2adeca07391e
Rebooting...
ESP-ROM:esp32h2-20221101
Build:Nov 1 2022
rst:0xc (SW_CPU),boot:0xd (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x4083cfd0,len:0xc10
load:0x4083efd0,len:0x2da4
load:0x408460e8,len:0x177c
entry 0x4083cfd0
I (25) boot: ESP-IDF v5.1.1 2nd stage bootloader
I (26) boot: compile time Nov 16 2023 12:16:10
I (27) boot: chip revision: v0.1
I (28) boot.esp32h2: SPI Speed : 64MHz
I (33) boot.esp32h2: SPI Mode : DIO
I (37) boot.esp32h2: SPI Flash Size : 2MB
I (42) boot: Enabling RNG early entropy source...
I (48) boot: Partition Table:
I (51) boot: ## Label Usage Type ST Offset Length
I (58) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (66) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (73) boot: 2 factory factory app 00 00 00010000 000a2800
I (81) boot: 3 zb_storage Unknown data 01 81 000b3000 00004000
I (88) boot: 4 zb_fct Unknown data 01 81 000b7000 00000400
I (96) boot: End of partition table
I (100) esp_image: segment 0: paddr=00010020 vaddr=42068020 size=114f0h ( 70896) map
I (140) esp_image: segment 1: paddr=00021518 vaddr=40800000 size=06b00h ( 27392) load
I (156) esp_image: segment 2: paddr=00028020 vaddr=42000020 size=67310h (422672) map
I (346) esp_image: segment 3: paddr=0008f338 vaddr=40806b00 size=0726ch ( 29292) load
I (363) esp_image: segment 4: paddr=000965ac vaddr=4080dd70 size=0154ch ( 5452) load
I (368) esp_image: segment 5: paddr=00097b00 vaddr=50000000 size=00004h ( 4) load
I (377) boot: Loaded app from partition at offset 0x10000
I (378) boot: Disabling RNG early entropy source...
I (392) cpu_start: Unicore app
I (393) cpu_start: Pro cpu up.
W (402) clk: esp_perip_clk_init() has not been implemented yet
I (409) cpu_start: Pro cpu start user code
I (409) cpu_start: cpu freq: 96000000 Hz
I (409) cpu_start: Application information:
I (412) cpu_start: Project name: sleepy_end_device
I (417) cpu_start: App version: 1
I (422) cpu_start: Compile time: Nov 16 2023 12:14:58
I (428) cpu_start: ELF file SHA256: bc4e2adeca07391e...
I (434) cpu_start: ESP-IDF: v5.1.1
I (439) cpu_start: Min chip rev: v0.0
I (443) cpu_start: Max chip rev: v0.99
I (448) cpu_start: Chip rev: v0.1
I (453) heap_init: Initializing. RAM available for dynamic allocation:
I (460) heap_init: At 40815BF0 len 00037790 (221 KiB): D/IRAM
I (467) heap_init: At 4084D380 len 00002B60 (10 KiB): STACK/DIRAM
I (474) spi_flash: detected chip: generic
I (478) spi_flash: flash io: dio
W (482) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (495) sleep: Enable automatic switching of GPIO sleep configuration
I (503) sleep_clock: System Power, Clock and Reset sleep retention initialization
I (511) sleep_clock: Modem Power, Clock and Reset sleep retention initialization
I (519) sleep_sys_periph: Interrupt Matrix sleep retention initialization
I (526) sleep_sys_periph: HP System sleep retention initialization
I (533) sleep_sys_periph: TEE/APM sleep retention initialization
I (540) sleep_sys_periph: UART sleep retention initialization
I (546) sleep_sys_periph: Timer Group sleep retention initialization
I (553) sleep_sys_periph: IO Matrix sleep retention initialization
I (560) sleep_sys_periph: SPI Mem sleep retention initialization
I (567) sleep_sys_periph: SysTimer sleep retention initialization
I (585) app_start: Starting scheduler on CPU0
I (586) main_task: Started on CPU0
I (586) main_task: Calling app_main()
I (597) pm: Frequency switching config: CPU_MAX: 96, APB_MAX: 96, APB_MIN: 96, Light sleep: ENABLED
I (598) esp_zb_sleep: Enable ieee802154 zigbee light sleep, the wake up source is ESP timer
I (619) phy: phy_version: 200,0, 8a31b65, Jun 6 2023, 20:13:10
I (620) phy: libbtbb version: 98b760f, Jun 6 2023, 20:13:22
I (622) btbb_init: btbb sleep retention initialization
I (628) ieee802154: ieee802154 mac sleep retention initialization
I (658) ESP_ZB_SLEEP: ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
I (659) ESP_ZB_SLEEP: Zigbee stack initialized
I (662) ESP_ZB_SLEEP: Start network steering
I (656) main_task: Returned from app_main()
I (9273) ESP_ZB_SLEEP: Zigbee can sleep
I (9645) ESP_ZB_SLEEP: Zigbee can sleep
I (9793) ESP_ZB_SLEEP: Zigbee can sleep
I (19315) ESP_ZB_SLEEP: ZDO signal: ZDO Leave (0x3), status: ESP_OK
abort() was called at PC 0x42017e9f on core 0
Core 0 register dump:
MEPC : 0x4080063a RA : 0x408084fc SP : 0x4084ee30 GP : 0x4080e574
TP : 0x4083e2ac T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x4084ee94 A0 : 0x4084ee5c A1 : 0x4084ee92
A2 : 0x00000000 A3 : 0x4084ee89 A4 : 0x00000001 A5 : 0x40816000
A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000001 S3 : 0x0000077b
S4 : 0x00000038 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
4084ee30: 0x40817d58 0x40850000 0x4084ee90 0x4080cc62 0x4206cf2c 0x4206eaf0 0x00000003 0x4080ecc8
4084ee50: 0x4084ee94 0x4080ece4 0x4084ee90 0x726f6261 0x20292874 0x20736177 0x6c6c6163 0x61206465
4084ee70: 0x43502074 0x34783020 0x37313032 0x20663965 0x63206e6f 0x2065726f 0x00000030 0x42050000
4084ee90: 0x00000030 0x31303234 0x66396537 0x00000700 0x00000000 0x00000000 0x00000038 0x42017ea2
4084eeb0: 0x00000000 0x00000000 0x40810430 0x42026562 0x00000000 0x00000000 0x00000000 0x4201cae0
4084eed0: 0x00000000 0x4202654e 0x0000077b 0x423b391e 0x0000003c 0x00000004 0x00000000 0x00000000
4084eef0: 0x00000000 0x00000000 0x00000000 0x42038eb4 0x00000000 0x00000000 0x40817d38 0x4200f030
4084ef10: 0x00000000 0x00000000 0x00000000 0x4200a748 0x00000000 0x00000008 0x00000000 0x00000000
4084ef30: 0x00000000 0x00000002 0x00060000 0x00000fa0 0x00000000 0x00000000 0x00000000 0x4080a936
4084ef50: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084ef70: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000154 0x4084ed60 0x000070ab
4084ef90: 0x4080f4cc 0x4080f4cc 0x4084ef88 0x4080f4c4 0x00000014 0x40817d84 0x40817d84 0x4084ef88
4084efb0: 0x00000000 0x00000005 0x4084df84 0x6267695a 0x6d5f6565 0x006e6961 0x00ffffff 0x00000000
4084efd0: 0x4084ef80 0x00000005 0x00000000 0x00000000 0x00000000 0x00000009 0x408165a4 0x4081660c
4084eff0: 0x40816674 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x4205a484
4084f010: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084f030: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084f050: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084f070: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084f090: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084f0b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4084f0d0: 0x00000000 0x00000000 0x40000000 0x00000020 0x00000000 0x00000000 0x00000003 0x420717f8
4084f0f0: 0x40819390 0x00000001 0xb33fffff 0x00000000 0x00000054 0x00000000 0x4084f104 0x00000000
4084f110: 0x00000000 0x00000000 0x4084f11c 0xffffffff 0x4084f11c 0x4084f11c 0x00000000 0x4084f130
4084f130: 0xffffffff 0x4084f130 0x4084f130 0x00000001 0x00000001 0x00000000 0x0000ffff 0x00000000
4084f150: 0xb33fffff 0x00000000 0x00000054 0x00000000 0x4084f15c 0x00000000 0x00000000 0x00000000
4084f170: 0x4084f174 0xffffffff 0x4084f174 0x4084f174 0x00000000 0x4084f188 0xffffffff 0x4084f188
4084f190: 0x4084f188 0x00000001 0x00000001 0x00000000 0x0000ffff 0x00000000 0xb33fffff 0x00000000
4084f1b0: 0x00000020 0x01c3f8d9 0x00000000 0x000f4240 0x00000000 0x4205487a 0x00000000 0x00000000
4084f1d0: 0x40815a54 0x00000054 0x00000000 0x4084f1d8 0x00000000 0x00000000 0x00000000 0x4084f1f0
4084f1f0: 0xffffffff 0x4084f1f0 0x4084f1f0 0x00000000 0x4084f204 0xffffffff 0x4084f204 0x4084f204
4084f210: 0x00000001 0x00000001 0x00000000 0x3600ffff 0x00000000 0xb33fffff 0x00000000 0x00000028 |
I'm facing the same issue with the esp_HA-Costumized_light and esp_HA-Costumized_switch example. I try it with other examples that I know that are working on the past and the same thing! |
I tested the examples esp-zigbee-HA-switch and esp-zigbee-sleep from the esp-zigbee-sdk, and there were no crashes. Could you please provide details about your test environment? Additionally, could you specify the device you expect the sleep device to join? I recommend updating the ESP-IDF version to v5.1.2 for testing, as it provides enhanced stability for sleep support. |
I also utilized the master branch of esp-zigbee-sdk to test the esp_zigbee_customized_devices, and it performed reliably. Could you please provide the crash log for your test in the example? |
Hai @xieqinan |
I update the esp-idf to last version 5.1.2, and the crash remains. This are my specifications: esp-zigbee-lib version. esp-zboss-lib version. Espressif SoC revision. When the assert occurs, that is the reason: I (482) spi_flash: flash io: dio assert failed: zb_osif_nvram_init zb_esp_nvram.c:70 (zb_partition != NULL) |
Hai @nalves23 Its look like you made changes in partition table. |
Hi @Bosemani No, I kept the partition configuration as it was in the example: Name, Type, SubType, Offset, Size, FlagsNote: if you have increased the bootloader size, make sure to update the offsets to avoid overlapnvs, data, nvs, 0x9000, 0x6000, Do you have some suggestions I might consider? Regards. |
@nalves23 According to the log you provided, assert failed at If the partition table is configured correctly, you can try |
@chshu following here on your comment on #99 I have just tested the light_sleep example from c46797a. I followed my reproduction steps from my first post in this issue. I have changed the idf_component.yml to: ## IDF Component Manager Manifest File
dependencies:
espressif/esp-zigbee-lib:
version: "main"
path: "components/esp-zigbee-lib"
git: "https://github.com/espressif/esp-zigbee-sdk"
espressif/esp-zboss-lib:
version: "master"
git: "https://github.com/espressif/esp-zboss-lib"
# Required IDF version
idf:
version: ">=5.0.0" Now the device doesn't seem to crash, but every time it goes to sleep (before it evens joins the network?), it reboots after a couple seconds without reason:
It does this in a loop, it retries to join the network, goes to sleep, reboots. |
@blastrock It seems like you have integrated our zigbee-sdk into your code. Please add the relevant configurations for esp32c6 in the esp-zigbee-sdk light sleep to your example code. For instance CONFIG_ESP_PHY_MAC_BB_PD=y and sdkconfig.defaults). |
I am testing that light sleep example you linked, this is not integrated in my project, I opened the example directly with vscode. I have just tested again with commit 796eb80 and it seems to work! It connects and does not reboot. I see however that it wakes up quite often. I tried changing ED_KEEP_ALIVE to 40000 but it still wakes up at least once every 5s, some times multiple times per second. Is this some technical limitation of the zigbee protocol?
|
@blastrock The configuration of the long poll interval through Therefore, it is recommended to call Please add the following code in the Zigbee sleep example:
|
Thanks again for the help! Just a note that may help other people reading: I noticed that when we set this interval to a value, say 40s, it actually does 40s cycles where:
The 17s seem to be non-compressible, but we can always set the interval very high so that it stays awake 17s and then sleeps 100s or more. This is fine for my use, and this issue is fixed, I'm closing it. |
@blastrock Could you provide the environment to reproduce this issue and ? I have only change this:
|
I applied the same patch as you on the light sleep example, and reproduce the behavior:
The device wakes up every 40s (at 44000 and 84000) but wake up regularly for 17s each time. I'm using the example code from 926a2fa and esp-zboss and esp-zigbee 1.0.7. I'm using esp-idf master's branch from 3 weeks ago https://github.com/espressif/esp-idf/tree/f0607f6d3b4b3bfcbebdd9c580c6a034a183aad6 . The device connects to my actual home network, which has a few sensors, lights and switches. The orchestrator is zigbee2mqtt. |
@blastrock Thank you very much for the information you provided. Based on the environment you shared, I couldn't reproduce it using the HA_on_off_switch and light_sleep examples. Therefore, the difference should be related to the coordinator. Could you provide packet capture files when you reproduce this scenario? If possible, it would be best to provide them in a format that can be opened with Wireshark software. Thanks a lot. |
@kelin6 I'm experiencing the same exact issue of the first post. Just to be clear, is ESP32-C6 light sleep support in ESP-IDF 5.1.2 and current master zboss and zigbee sdk? |
I can answer my question... 5.1.2 does not supports esp32-c6 light sleep. Support starts with 5.2 (not yet stable). I'm cloning the 5.2 branch right now, I'm sure that's the problem. |
@kelin6 regarding the power profiling image that we can find in the light sleep example, I suppose it is related to the esp32-h2. |
@Suxsem Yes, This is the power consumption of esp32h2 in light sleep working with a 4 seconds keep-alive interval. Compared to the esp32h2, the power consumption of esp32c6 in light sleep is slightly higher, as shown in the following figure.
|
Much much appreciated, thank you!!! |
Answers checklist.
IDF version.
v5.1.1
esp-zigbee-lib version.
~1.0.0
esp-zboss-lib version.
~1.0.0
Espressif SoC revision.
ESP32-C6-DevKitC-1
What is the expected behavior?
Not crash
What is the actual behavior?
The device somehow fails to connect and crashes with the following log:
Steps to reproduce.
More Information.
This is a regression. I didn't have this issue with esp-zboss-lib 0.6.2 and esp-zigbee-lib 0.9.5.
The text was updated successfully, but these errors were encountered: