esp-zigbee-sdk: Unknown error, not sure what causes it (TZ-104)
Currently I’m trying to modify the “HA_on_off_light” example to work with the preconfigured temperature device. I didn’t change anything in the “esp_zb_init()” parameters and the code before but suddenly throws error:
assert failed: zb_osif_nvram_init zb_esp_nvram.c:70 (zb_partition != NULL)
Core 0 register dump:
MEPC : 0x4080062e RA : 0x4080862e SP : 0x4087e120 GP : 0x4080e050
0x4080062e: panic_abort at C:/Users/Tropaion/esp/esp-idf/components/esp_system/panic.c:451
0x4080862e: __ubsan_include at C:/Users/Tropaion/esp/esp-idf/components/esp_system/ubsan.c:313
TP : 0x40873708 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x0000007d S1 : 0x00000001 A0 : 0x4087e15c A1 : 0x4080e245
A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x40815000
A6 : 0x0000000c A7 : 0x76757473 S2 : 0x00000009 S3 : 0x4087e27a
S4 : 0x4080e244 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
0x40800001: _vector_table at ??:?
MHARTID : 0x00000000
Stack memory:
4087e120: 0xa5a5a5a5 0x00000004 0x420541bc 0x4080c88a 0x4080e860 0x420541bc 0x4080eb48 0x42054181
0x4080c88a: newlib_include_assert_impl at C:/Users/Tropaion/esp/esp-idf/components/newlib/assert.c:93
4087e140: 0x4080e870 0x4087e154 0x4080e874 0x42054130 0x4080e244 0x00003037 0x4087e19c 0x65737361
4087e160: 0x66207472 0x656c6961 0x7a203a64 0x736f5f62 0x6e5f6669 0x6d617276 0x696e695f 0x627a2074
4087e180: 0x7073655f 0x72766e5f 0x632e6d61 0x2030373a 0x5f627a28 0x74726170 0x6f697469 0x3d21206e
4087e1a0: 0x4c554e20 0x0000294c 0x4087cf00 0x40808cb8 0x00000000 0x00000000 0x408171d0 0x4080c590
0x40808cb8: xQueueGenericSend at C:/Users/Tropaion/esp/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:999
0x4080c590: _multi_heap_unlock at C:/Users/Tropaion/esp/esp-idf/components/heap/multi_heap.c:94 (discriminator 1)
4087e1c0: 0x00000000 0x00000000 0x00000000 0x40022498 0x40880000 0x4087cfcc 0x4087c610 0x400225ca
4087e1e0: 0x42054124 0x00000000 0x4087cfcc 0x40800ac8 0x00000001 0x00000014 0x4087cfcc 0x4080c8b0
0x40800ac8: heap_caps_free at C:/Users/Tropaion/esp/esp-idf/components/heap/heap_caps.c:391
0x4080c8b0: free at C:/Users/Tropaion/esp/esp-idf/components/newlib/heap.c:40
4087e200: 0x42054124 0x00000000 0x4087cfcc 0x4203cebe 0xffffffff 0xffffffff 0x00000000 0x4203cf78
0x4203cebe: esp_partition_iterator_release at C:/Users/Tropaion/esp/esp-idf/components/esp_partition/partition.c:357
0x4203cf78: esp_partition_next at C:/Users/Tropaion/esp/esp-idf/components/esp_partition/partition.c:333
4087e220: 0x42054124 0x00000000 0x00000000 0x42000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e240: 0x00000000 0x00000000 0x4080fd18 0x420363ba 0x4080a9b8 0x00000000 0x4087e2a4 0x4200f0ae
0x420363ba: zb_osif_nvram_init at ??:?
0x4080a9b8: vPortTaskWrapper at C:/Users/Tropaion/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:198
0x4200f0ae: zb_init at ??:?
4087e260: 0x40873708 0x00000000 0x4087e2a4 0x42007624 0x00000000 0x00000000 0x00000000 0x000001ce
0x42007624: esp_zb_init at ??:?
4087e280: 0x420533bc 0x000001ba 0x42053000 0x42007166 0x00000000 0x00000000 0x00000000 0x00000000
0x42007166: zb_hte501_task at C:/Users/Tropaion/Desktop/ZB_HTE501/components/zb_hte501/zb_hte501.c:105
4087e2a0: 0x00000000 0x00000002 0x00060000 0x00000bb8 0x00000000 0x00000000 0x00000000 0x4080a9c4
0x4080a9c4: vPortTaskWrapper at C:/Users/Tropaion/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:205
4087e2c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e2e0: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000154
4087e300: 0x4087e250 0x4087c624 0x4080f28c 0x4080f28c 0x4087e300 0x4080f284 0x00000014 0x00076270
4087e320: 0x00000000 0x4087e300 0x00000000 0x00000005 0x4087d2fc 0x4d5f425a 0x004e4941 0x00000000
4087e340: 0x00000000 0x00000000 0x4087e2f0 0x00000005 0x00000000 0x00000000 0x00000000 0x00000000
4087e360: 0x40815cd8 0x40815d40 0x40815da8 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000
4087e380: 0x00000000 0x4204b43a 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x4204b43a: _cleanup_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/findfp.c:229
4087e3a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e3c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e3e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e400: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e420: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e440: 0x00000000 0x00000000 0x00000000 0x00000000 0x40000000 0x00001109 0x4087c624 0x4087c624
4087e460: 0x80b828cb 0x00000000 0x00010000 0x100203e9 0x4086c410 0x40875720 0x0000185c 0x000000ee
4087e480: 0x0000000d 0x00006300 0x01000000 0x42005120 0x7533885e 0xb39fa107 0x07baf049 0xb378de82
0x42005120: esp_vfs_select at C:/Users/Tropaion/esp/esp-idf/components/vfs/vfs.c:917
4087e4a0: 0x0ea767ad 0x20dfea06 0xda0e9ec1 0x1b4a1caf 0x0d4c72b7 0x00000000 0x00000000 0x00000000
4087e4c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x4087e5f0 0x00000101 0x00000002
4087e4e0: 0xb39fa107 0x07baf049 0xb378de82 0x0ea767ad 0x20dfea06 0xda0e9ec1 0x1b4a1caf 0x0d4c72b7
4087e500: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
ELF file SHA256: 1d8a0c115d9888ad
Code Snippet:
#define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */
#define ED_AGING_TIMEOUT ESP_ZB_ED_AGING_TIMEOUT_64MIN
#define ED_KEEP_ALIVE 3000 /* 3000 millisecond */
#define HA_ESP_TEMPERATURE_ENDPOINT 1 /* temperature endpoint id */
#define HA_ESP_HUMIDITY_ENDPOINT 2 /* humidity endpoint id */
#define ZB_PRIMARY_CHANNEL_MASK 0x07FFF800 /* Enable all channels (11-26) */
/**
* @brief Configure as zigbee end-device
*/
#define ZB_ZED_CONFIG() \
{ \
.esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \
.install_code_policy = INSTALLCODE_POLICY_ENABLE, \
.nwk_cfg.zed_cfg = { \
.ed_timeout = ED_AGING_TIMEOUT, \
.keep_alive = ED_KEEP_ALIVE, \
}, \
}
/**
* @brief In this function, the device functionality (clusters, endpoints) is defined and application will be started
*
* @param pvParameters
*/
static void zb_hte501_task(void *pvParameters)
{
ESP_LOGI(TAG, "ZB TASK STARTED!");
// Initialize zigbee stack with end-device config
esp_zb_cfg_t zb_nwk_cfg = ZB_ZED_CONFIG();
esp_zb_init(&zb_nwk_cfg);
ESP_LOGI(TAG, "ZB INIT DONE!");
// Configure temperature cluster
//esp_zb_temperature_meas_cluster_cfg_t temperature_cfg; = ESP_ZB_DEFAULT_TEMPERATURE_SENSOR_CONFIG();
// Configure humidity cluster
//esp_zb_humidity_meas_cluster_cfg_t humidity_cfg;
// Create list of clusters
//esp_zb_ep_list_t *zb_hte501_ep = esp_zb_temperature_meas_cluster_create();
// For test, use preconfigured temperature device
esp_zb_temperature_sensor_cfg_t temperature_cfg = ESP_ZB_DEFAULT_TEMPERATURE_SENSOR_CONFIG();
// Create endpoint list for device
esp_zb_ep_list_t *temperature_ep = esp_zb_temperature_sensor_ep_create(HA_ESP_TEMPERATURE_ENDPOINT, &temperature_cfg);
// Register device to stack
esp_zb_device_register(temperature_ep);
ESP_LOGI(TAG, "REGISTER DONE!");
// Add attribute callback function
// TODO: Is it needed?
//esp_zb_device_add_set_attr_value_cb(func_attr_callback);
// Set which zigbee channels to use
esp_zb_set_primary_network_channel_set(ZB_PRIMARY_CHANNEL_MASK);
// Start zigbee and check for error, afterwards, function "esp_zb_app_signal_handler" is called
// TODO: Check autostart in detail
ESP_LOGI(TAG, "BEFORE START!");
ESP_ERROR_CHECK(esp_zb_start(false));
// Run zigbee functionality in loop because esp_zb_start is set false
esp_zb_main_loop_iteration();
}
esp_err_t zb_hte501_init()
{
// Initialize non-volatile flash
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "FLASH INIT DONE!");
// Operating mode (single processor or co-processor)
esp_zb_platform_config_t config = {
.radio_config = ZB_DEFAULT_RADIO_CONFIG(),
.host_config = ZB_DEFAULT_HOST_CONFIG(),
};
// Set operating mode
ESP_ERROR_CHECK(esp_zb_platform_config(&config));
ESP_LOGI(TAG, "CONFIG DONE");
// TODO: Maybe initialize sensor here?
// Create zigbee background task
xTaskCreate(zb_hte501_task, "ZB_MAIN", 4096, NULL, 5, NULL);
return ESP_OK;
}
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 27 (13 by maintainers)
For our API design, we should separate them for single functionality purpose. For now, we just do
esp_zb_zcl_set_attribute_valand then callesp_zb_zcl_report_attr_cmd_reqto send your changed attribute to remote node.