Description
Board
ESP32-C6 dev module
Device Description
ESP32-C6-WROOM-1 module on a generic ebay development board with 2 USB-C ports.
Hardware Configuration
There is no other hardware attached to the board.
Version
latest development Release Candidate (RC-X)
IDE Name
Arduino IDE v1.8.19
Operating System
Windows 11
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
I wanted to try out the Zigbee analog input output example. The code compiled okay, was flashed to the board, paired up with zigbee network (Home Assistant via Sonoff dongle) and crashed. Since then it keeps crashing as soon as it connects to the network. The example was completely unmodified.
Sketch
// Copyright 2025 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @brief This example demonstrates Zigbee analog input / output device.
*
* The example demonstrates how to use Zigbee library to create a end device analog device.
*
* Proper Zigbee mode must be selected in Tools->Zigbee mode
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
*
* Please check the README.md for instructions and more detailed description.
*
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
* Modified by Pat Clay
*/
#ifndef ZIGBEE_MODE_ED
#error "Zigbee end device mode is not selected in Tools->Zigbee mode"
#endif
#include "Zigbee.h"
/* Zigbee analog device configuration */
#define ANALOG_DEVICE_ENDPOINT_NUMBER 1
uint8_t analogPin = A0;
uint8_t button = BOOT_PIN;
ZigbeeAnalog zbAnalogDevice = ZigbeeAnalog(ANALOG_DEVICE_ENDPOINT_NUMBER);
void onAnalogOutputChange(float analog_output) {
Serial.printf("Received analog output change: %.1f\r\n", analog_output);
}
void setup() {
Serial.begin(115200);
Serial.println("Starting...");
// Init button switch
pinMode(button, INPUT_PULLUP);
// Set analog resolution to 10 bits
analogReadResolution(10);
// Optional: set Zigbee device name and model
zbAnalogDevice.setManufacturerAndModel("Espressif", "ZigbeeAnalogDevice");
// Add analog clusters to Zigbee Analog according your needs
zbAnalogDevice.addAnalogInput();
zbAnalogDevice.addAnalogOutput();
// If analog output cluster is added, set callback function for analog output change
zbAnalogDevice.onAnalogOutputChange(onAnalogOutputChange);
// Add endpoints to Zigbee Core
Zigbee.addEndpoint(&zbAnalogDevice);
Serial.println("Starting Zigbee...");
// When all EPs are registered, start Zigbee in End Device mode
if (!Zigbee.begin()) {
Serial.println("Zigbee failed to start!");
Serial.println("Rebooting...");
ESP.restart();
} else {
Serial.println("Zigbee started successfully!");
}
Serial.println("Connecting to network");
while (!Zigbee.connected()) {
Serial.print(".");
delay(100);
}
Serial.println("Connected");
// Optional: Add reporting for analog input
zbAnalogDevice.setAnalogInputReporting(0, 30, 10); // report every 30 seconds if value changes by 10
}
void loop() {
static uint32_t timeCounter = 0;
// Read ADC value and update the analog value every 2s
if (!(timeCounter++ % 20)) { // delaying for 100ms x 20 = 2s
float analog = (float)analogRead(analogPin);
Serial.printf("Updating analog input to %.1f\r\n", analog);
zbAnalogDevice.setAnalogInput(analog);
// Analog input supports reporting
zbAnalogDevice.reportAnalogInput();
}
// Checking button for factory reset and reporting
if (digitalRead(button) == LOW) { // Push button pressed
// Key debounce handling
delay(100);
int startTime = millis();
while (digitalRead(button) == LOW) {
delay(50);
if ((millis() - startTime) > 3000) {
// If key pressed for more than 3secs, factory reset Zigbee and reboot
Serial.println("Resetting Zigbee to factory and rebooting in 1s.");
delay(1000);
Zigbee.factoryReset();
}
}
}
delay(100);
}
Debug Message
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1260
load:0x4086c110,len:0xdc4
load:0x4086e610,len:0x300c
entry 0x4086c110
[ 1][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x420068e2
[ 12][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x420068a6
[ 23][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x4200686a
[ 34][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x4200682e
[ 46][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x420068e2
[ 57][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x420068a6
[ 68][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x4200686a
[ 80][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x4200682e
[ 91][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x420068e2
[ 102][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x420068a6
[ 114][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x4200686a
[ 125][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x4200682e
[ 137][V][ZigbeeEP.cpp:18] ZigbeeEP(): Endpoint: 1
[ 153][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 17 successfully set to type UART_RX (2) with bus 0x4080e164
[ 164][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 16 successfully set to type UART_TX (3) with bus 0x4080e164
=========== Before Setup Start ===========
Chip Info:
------------------------------------------
Model : ESP32-C6
Package : 0
Revision : 0.01
Cores : 1
CPU Frequency : 160 MHz
XTAL Frequency : 40 MHz
Features Bitfield : 0x00000052
Embedded Flash : No
Embedded PSRAM : No
2.4GHz WiFi : Yes
Classic BT : No
BT Low Energy : Yes
IEEE 802.15.4 : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
Total Size : 451312 B ( 440.7 KB)
Free Bytes : 412672 B ( 403.0 KB)
Allocated Bytes : 31960 B ( 31.2 KB)
Minimum Free Bytes: 412672 B ( 403.0 KB)
Largest Free Block: 385012 B ( 376.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
Chip Size : 8388608 B (8 MB)
Block Size : 65536 B ( 64.0 KB)
Sector Size : 4096 B ( 4.0 KB)
Page Size : 256 B ( 0.2 KB)
Bus Speed : 40 MHz
Bus Mode : QIO
------------------------------------------
Partitions Info:
------------------------------------------
nvs : addr: 0x00009000, size: 20.0 KB, type: DATA, subtype: NVS
otadata : addr: 0x0000E000, size: 8.0 KB, type: DATA, subtype: OTA
app0 : addr: 0x00010000, size: 3328.0 KB, type: APP, subtype: OTA_0
app1 : addr: 0x00350000, size: 3328.0 KB, type: APP, subtype: OTA_1
spiffs : addr: 0x00690000, size: 1388.0 KB, type: DATA, subtype: SPIFFS
zb_storage : addr: 0x007EB000, size: 16.0 KB, type: DATA, subtype: FAT
zb_fct : addr: 0x007EF000, size: 4.0 KB, type: DATA, subtype: FAT
coredump : addr: 0x007F0000, size: 64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
Compile Date/Time : Mar 6 2025 14:49:34
Compile Host OS : windows
ESP-IDF Version : v5.4-561-gbcb3c32d3a-dirty
Arduino Version : 3.2.0
------------------------------------------
Board Info:
------------------------------------------
Arduino Board : ESP32C6_DEV
Arduino Variant : esp32c6
Arduino FQBN : esp32:esp32:esp32c6:JTAGAdapter=default,CDCOnBoot=default,PartitionScheme=zigbee_8MB,CPUFreq=160,FlashMode=qio,FlashFreq=80,FlashSize=8M,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=all,ZigbeeMode=ed
============ Before Setup End ============
[ 505][V][esp32-hal-uart.c:552] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(17) txPin(16)
[ 513][V][esp32-hal-uart.c:656] uartBegin(): UART0 not installed. Starting installation
[ 521][V][esp32-hal-uart.c:666] uartBegin(): UART0 RX FIFO full threshold set to 120 (value requested: 120 || FIFO Max = 128)
[ 533][V][esp32-hal-uart.c:683] uartBegin(): Setting UART0 to use XTAL clock
[ 540][V][esp32-hal-uart.c:738] uartBegin(): UART0 initialization done.
[ 547][V][esp32-hal-uart.c:785] uartSetRxFIFOFull(): UART0 RX FIFO Full value set to 120 from a requested value of 120
Starting...
[ 558][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42003aa0
[ 570][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[ 580][D][ZigbeeCore.cpp:83] addEndpoint(): Endpoint: 1, Device ID: 0x000c
Starting Zigbee...
[ 587][D][ZigbeeCore.cpp:126] zigbeeInit(): Initialize Zigbee stack
[ 668][D][ZigbeeCore.cpp:133] zigbeeInit(): Register all Zigbee EPs in list
[ 676][I][ZigbeeCore.cpp:141] zigbeeInit(): List of registered Zigbee EPs:
[ 683][I][ZigbeeCore.cpp:143] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 1, Device ID: 0x000c
[ 701][V][ZigbeeCore.cpp:355] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[ 712][I][ZigbeeCore.cpp:222] esp_zb_app_signal_handler(): Zigbee stack initialized
[ 3071][I][ZigbeeCore.cpp:228] esp_zb_app_signal_handler(): Device started up in non factory-reset mode
[ 3080][I][ZigbeeCore.cpp:241] esp_zb_app_signal_handler(): Device rebooted
[ 3087][D][ZigbeeCore.cpp:482] searchBindings(): Requesting binding table for address 0xbf38
[ 3096][D][ZigbeeCore.cpp:422] bindingTableCb(): Binding table callback for address 0xbf38 with status 0
[ 3106][D][ZigbeeCore.cpp:425] bindingTableCb(): Binding table info: total 0, index 0, count 0
[ 3114][D][ZigbeeCore.cpp:428] bindingTableCb(): No binding table entries found
Zigbee started successfully!
Connecting to network
Connected
Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x420272d8 RA : 0x4202e8f4 SP : 0x4081d800 GP : 0x4080e7d4
TP : 0x4081d8c0 T0 : 0x40030dca T1 : 0x0000000f T2 : 0x40822a54
S0/FP : 0x0000001e S1 : 0x4081d828 A0 : 0x00000000 A1 : 0x00000000
A2 : 0x0000ffff A3 : 0x0000000d A4 : 0x40822a64 A5 : 0x0000000d
A6 : 0x00000004 A7 : 0x00000004 S2 : 0x00000001 S3 : 0x40810310
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000014 T4 : 0x40815000 T5 : 0x40815000 T6 : 0x00000001
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000005 MTVAL : 0x00000005
MHARTID : 0x00000000
Stack memory:
4081d800: 0x41200000 0x00000000 0x0000001e 0x4200ae18 0x00000001 0x420734f8 0x4080e164 0x4200375a
4081d820: 0x00000000 0x00000000 0x04020100 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000
4081d840: 0x001e0000 0x0000000a 0x00000000 0x00000000 0x00000000 0x001e0000 0x00000000 0xffff0104
4081d860: 0x00000014 0x40815000 0x40815000 0x00000000 0x00000000 0x00000000 0x40815000 0x42005a96
4081d880: 0x00000000 0x00000000 0x00000000 0x4080836c 0x00000000 0x00000000 0x00000000 0x00000000
4081d8a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d8c0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000168 0xabba1234 0x0000015c 0x4081d760
4081d8e0: 0x00007757 0x40812ee4 0x40812ee4 0x4081d8dc 0x40812edc 0x00000018 0x408161cc 0x408161cc
4081d900: 0x4081d8dc 0x00000000 0x00000001 0x4081b8cc 0x706f6f6c 0x6b736154 0x00000000 0x00000000
4081d920: 0x4081d8c0 0x00000005 0x00000000 0x00000001 0x00000001 0x00000000 0x00000000 0x0006b9eb
4081d940: 0x00000000 0x40815c24 0x40815c8c 0x40815cf4 0x00000000 0x00000000 0x00000001 0x00000000
4081d960: 0x00000000 0x4081da48 0x42049b3c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d980: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d9a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d9c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d9e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081da00: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081da20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbaad5678 0x0000001c
4081da40: 0xabba1234 0x00000010 0x4081db28 0x00000000 0x00000000 0x4081da68 0xbaad5678 0x00000090
4081da60: 0xabba1234 0x00000084 0x00000000 0x4081dafc 0x00000000 0x00000000 0x00000000 0x00000000
4081da80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081daa0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081dac0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081dae0: 0x00000000 0x00000000 0x00000000 0xbaad5678 0x00000028 0xabba1234 0x0000001c 0x4081db50
4081db00: 0x00000001 0x00000002 0x00000000 0x00000001 0x00000001 0x00000000 0xbaad5678 0x00000024
4081db20: 0xabba1234 0x00000018 0x00303436 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000
4081db40: 0xbaad5678 0x00000028 0xabba1234 0x0000001c 0x4081db7c 0x00000001 0x00000002 0x00000000
4081db60: 0x00000001 0x08000000 0x00000000 0xbaad5678 0x00000028 0xabba1234 0x0000001c 0x00000000
4081db80: 0x00000001 0x00000002 0x00000000 0x00000001 0x04000000 0x00000000 0xbaad5678 0x0000348c
4081dba0: 0xabba1234 0x00003480 0x00000000 0x00480008 0x00000001 0x00000000 0x00000000 0x00000000
4081dbc0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081dbe0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
ELF file SHA256: dd417934c
Other Steps to Reproduce
Steps that led to this are:
- Connect ESP32C6 to the laptop
- Open the Analog Input Output example from the examples menu
- Compile and flash
- Add the device in Home Assistant
Here are my IDE settings
Tried this with an ESP32H2 and the same thing happened.
I'm using ZHA in HA and running Silicon Labs Multiprotocol firmware on the dongle.
I could not get the exception decoded using the decoder - I pasted it in and no output appeared.
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.