Просмотр исходного кода

Merge branch 'feature/Add_support_for_esp32c6' into 'master'

zigbee: Update examples to support esp32c6

See merge request espressif/esp-idf!21843
Shu Chen 3 лет назад
Родитель
Сommit
83d1bedb25

+ 4 - 4
examples/zigbee/.build-test-rules.yml

@@ -8,10 +8,10 @@ examples/zigbee/esp_zigbee_gateway:
 
 examples/zigbee/esp_zigbee_rcp:
   enable:
-    - if: IDF_TARGET == "esp32h4"
-      reason: should able to run on esp32h4
+    - if: IDF_TARGET in ["esp32h4", "esp32c6"]
+      reason: should able to run on esp32h4 and esp32c6
 
 examples/zigbee/light_sample:
   enable:
-    - if: IDF_TARGET == "esp32h4"
-      reason: should able to run on esp32h4
+    - if: IDF_TARGET in ["esp32h4", "esp32c6"]
+      reason: should able to run on esp32h4 and esp32c6

+ 2 - 2
examples/zigbee/esp_zigbee_gateway/main/idf_component.yml

@@ -1,7 +1,7 @@
 ## IDF Component Manager Manifest File
 dependencies:
-  espressif/esp-zboss-lib: "~0.2.0"
-  espressif/esp-zigbee-lib: "~0.3.0"
+  espressif/esp-zboss-lib: "~0.3.0"
+  espressif/esp-zigbee-lib: "~0.4.1"
   ## Required IDF version
   idf:
     version: ">=5.0.0"

+ 3 - 3
examples/zigbee/esp_zigbee_gateway/partitions.csv

@@ -2,6 +2,6 @@
 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
 nvs,        data, nvs,      0x9000,  0x6000,
 phy_init,   data, phy,      0xf000,  0x1000,
-factory,    app,  factory,  0x10000, 1M,
-zb_storage, data, fat,      0x110000, 128K,
-zb_fct,     data, fat,      0x130000, 1K,
+factory,    app,  factory,  0x10000, 550K,
+zb_storage, data, fat,      0x9a000, 128K,
+zb_fct,     data, fat,      0xba000, 1K,

+ 3 - 3
examples/zigbee/esp_zigbee_rcp/README.md

@@ -1,5 +1,5 @@
-| Supported Targets | ESP32-H4 |
-| ----------------- | -------- |
+| Supported Targets | ESP32-C6 | ESP32-H4 |
+| ----------------- | -------- | -------- |
 
 # Rcp Example
 
@@ -14,7 +14,7 @@ This test code shows how to configure Zigbee rcp (radio co-processor) device. Rc
 
 ## Configure the project
 
-Before project configuration and build, make sure to set the correct chip target using `idf.py --preview set-target esp32h4`
+Before project configuration and build, make sure to set the correct chip target using `idf.py --preview set-target TARGET` command.
 
 ## Erase the NVRAM
 

+ 2 - 0
examples/zigbee/esp_zigbee_rcp/main/esp_zigbee_rcp.c

@@ -40,6 +40,7 @@
 #include "freertos/task.h"
 #include "zb_scheduler.h"
 #include "esp_zigbee_rcp.h"
+#include "nvs_flash.h"
 
 #if (defined ZB_MACSPLIT_HOST && !defined ZB_MACSPLIT_DEVICE)
 #error Only Zigbee rcp device should be defined
@@ -71,6 +72,7 @@ void app_main(void)
         .radio_config = ESP_ZB_DEFAULT_RADIO_CONFIG(),
         .host_config = ESP_ZB_DEFAULT_HOST_CONFIG(),
     };
+    ESP_ERROR_CHECK(nvs_flash_init());
     /* load Zigbee rcp platform config to initialization */
     esp_zb_macsplit_set_version(RCP_COMPILE_DEFINE);
     ESP_ERROR_CHECK(esp_zb_platform_config(&config));

+ 2 - 2
examples/zigbee/esp_zigbee_rcp/main/idf_component.yml

@@ -1,7 +1,7 @@
 ## IDF Component Manager Manifest File
 dependencies:
-  espressif/esp-zboss-lib: "~0.2.0"
-  espressif/esp-zigbee-lib: "~0.3.0"
+  espressif/esp-zboss-lib: "~0.3.0"
+  espressif/esp-zigbee-lib: "~0.4.1"
   ## Required IDF version
   idf:
     version: ">=5.0.0"

+ 2 - 2
examples/zigbee/esp_zigbee_rcp/partitions.csv

@@ -2,5 +2,5 @@
 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
 nvs,        data, nvs,      0x9000,  0x6000,
 phy_init,   data, phy,      0xf000,  0x1000,
-factory,    app,  factory,  0x10000, 1M,
-zb_storage,    data, fat,             , 128K,
+factory,    app,  factory,  0x10000, 550K,
+zb_storage, data, fat,      0x9a000, 128K,

+ 0 - 1
examples/zigbee/esp_zigbee_rcp/sdkconfig.defaults

@@ -1,4 +1,3 @@
-CONFIG_IDF_TARGET="esp32h4"
 #
 # Partition Table
 #

+ 3 - 3
examples/zigbee/light_sample/HA_on_off_light/README.md

@@ -1,5 +1,5 @@
-| Supported Targets | ESP32-H4 |
-| ----------------- | -------- |
+| Supported Targets | ESP32-C6 | ESP32-H4 |
+| ----------------- | -------- | -------- |
 
 # Light Bulb Example
 
@@ -13,7 +13,7 @@ This test code shows how to configure Zigbee end device and use it as HA on/off
 
 ## Configure the project
 
-Before project configuration and build, make sure to set the correct chip target using `idf.py set-target esp32h4`.
+Before project configuration and build, make sure to set the correct chip target using `idf.py --preview set-target TARGET` command.
 
 ## Erase the NVRAM
 

+ 2 - 0
examples/zigbee/light_sample/HA_on_off_light/main/esp_zb_light.c

@@ -40,6 +40,7 @@
 #include "freertos/task.h"
 #include "ha/esp_zigbee_ha_standard.h"
 #include "esp_zb_light.h"
+#include "nvs_flash.h"
 
 /**
  * @note Make sure set idf.py menuconfig in zigbee component as zigbee end device!
@@ -128,6 +129,7 @@ void app_main(void)
         .radio_config = ESP_ZB_DEFAULT_RADIO_CONFIG(),
         .host_config = ESP_ZB_DEFAULT_HOST_CONFIG(),
     };
+    ESP_ERROR_CHECK(nvs_flash_init());
     /* load Zigbee light_bulb platform config to initialization */
     ESP_ERROR_CHECK(esp_zb_platform_config(&config));
     /* hardware related and device init */

+ 2 - 2
examples/zigbee/light_sample/HA_on_off_light/main/idf_component.yml

@@ -1,7 +1,7 @@
 ## IDF Component Manager Manifest File
 dependencies:
-  espressif/esp-zigbee-lib: "~0.3.0"
-  espressif/esp-zboss-lib: "~0.2.0"
+  espressif/esp-zigbee-lib: "~0.4.1"
+  espressif/esp-zboss-lib: "~0.3.0"
   espressif/led_strip: "~2.0.0"
   ## Required IDF version
   idf:

+ 3 - 3
examples/zigbee/light_sample/HA_on_off_light/partitions.csv

@@ -2,6 +2,6 @@
 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
 nvs,        data, nvs,      0x9000,  0x6000,
 phy_init,   data, phy,      0xf000,  0x1000,
-factory,    app,  factory,  0x10000, 1M,
-zb_storage, data, fat,      0x110000, 128K,
-zb_fct,     data, fat,      0x130000, 1K,
+factory,    app,  factory,  0x10000, 550K,
+zb_storage, data, fat,      0x9a000, 128K,
+zb_fct,     data, fat,      0xba000, 1K,

+ 0 - 1
examples/zigbee/light_sample/HA_on_off_light/sdkconfig.defaults

@@ -1,4 +1,3 @@
-CONFIG_IDF_TARGET="esp32h4"
 #
 # Partition Table
 #

+ 3 - 3
examples/zigbee/light_sample/HA_on_off_switch/README.md

@@ -1,5 +1,5 @@
-| Supported Targets | ESP32-H4 |
-| ----------------- | -------- |
+| Supported Targets | ESP32-C6 | ESP32-H4 |
+| ----------------- | -------- | -------- |
 
 # Light Switch Example
 
@@ -13,7 +13,7 @@ This test code shows how to configure Zigbee Coordinator and use it as an HA on/
 
 ## Configure the project
 
-Before project configuration and build, make sure to set the correct chip target using `idf.py set-target esp32h4`.
+Before project configuration and build, make sure to set the correct chip target using `idf.py --preview set-target TARGET` command.
 
 ## Erase the NVRAM
 

+ 2 - 0
examples/zigbee/light_sample/HA_on_off_switch/main/esp_zb_switch.c

@@ -40,6 +40,7 @@
 #include "freertos/task.h"
 #include "ha/esp_zigbee_ha_standard.h"
 #include "esp_zb_switch.h"
+#include "nvs_flash.h"
 
 /**
  * @note Make sure set idf.py menuconfig in zigbee component as zigbee coordinator device!
@@ -171,6 +172,7 @@ void app_main(void)
         .radio_config = ESP_ZB_DEFAULT_RADIO_CONFIG(),
         .host_config = ESP_ZB_DEFAULT_HOST_CONFIG(),
     };
+    ESP_ERROR_CHECK(nvs_flash_init());
     /* load Zigbee switch platform config to initialization */
     ESP_ERROR_CHECK(esp_zb_platform_config(&config));
     /* hardware related and device init */

+ 2 - 2
examples/zigbee/light_sample/HA_on_off_switch/main/idf_component.yml

@@ -1,7 +1,7 @@
 ## IDF Component Manager Manifest File
 dependencies:
-  espressif/esp-zigbee-lib: "~0.3.0"
-  espressif/esp-zboss-lib: "~0.2.0"
+  espressif/esp-zigbee-lib: "~0.4.1"
+  espressif/esp-zboss-lib: "~0.3.0"
   ## Required IDF version
   idf:
     version: ">=5.0.0"

+ 3 - 3
examples/zigbee/light_sample/HA_on_off_switch/partitions.csv

@@ -2,6 +2,6 @@
 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
 nvs,        data, nvs,      0x9000,  0x6000,
 phy_init,   data, phy,      0xf000,  0x1000,
-factory,    app,  factory,  0x10000, 1M,
-zb_storage,    data, fat,0x110000, 128K,
-zb_fct,data,fat,0x130000,1K
+factory,    app,  factory,  0x10000, 550K,
+zb_storage, data, fat,      0x9a000, 128K,
+zb_fct,     data, fat,      0xba000, 1K,

+ 0 - 1
examples/zigbee/light_sample/HA_on_off_switch/sdkconfig.defaults

@@ -1,4 +1,3 @@
-CONFIG_IDF_TARGET="esp32h4"
 #
 # Partition Table
 #