Skip to content

Zigbee protocol support #8844

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

Merged
merged 6 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ menu.EventsCore=Events Run On
menu.MemoryType=Memory Type
menu.EraseFlash=Erase All Flash Before Sketch Upload
menu.JTAGAdapter=JTAG Adapter
menu.ZigbeeMode=Zigbee Mode

# Custom options
menu.Revision=Board Revision
Expand Down Expand Up @@ -122,6 +123,12 @@ esp32h2.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
esp32h2.menu.PartitionScheme.rainmaker=RainMaker
esp32h2.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
esp32h2.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
esp32h2.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs
esp32h2.menu.PartitionScheme.zigbee.build.partitions=zigbee
esp32h2.menu.PartitionScheme.zigbee.upload.maximum_size=1310720
esp32h2.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
esp32h2.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
esp32h2.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
esp32h2.menu.PartitionScheme.custom=Custom
esp32h2.menu.PartitionScheme.custom.build.partitions=
esp32h2.menu.PartitionScheme.custom.upload.maximum_size=16777216
Expand Down Expand Up @@ -187,6 +194,20 @@ esp32h2.menu.EraseFlash.none.upload.erase_cmd=
esp32h2.menu.EraseFlash.all=Enabled
esp32h2.menu.EraseFlash.all.upload.erase_cmd=-e

esp32h2.menu.ZigbeeMode.default=Disabled
esp32h2.menu.ZigbeeMode.default.build.zigbee_mode=
esp32h2.menu.ZigbeeMode.default.build.zigbee_libs=
esp32h2.menu.ZigbeeMode.ed=Zigbee ED (end device)
esp32h2.menu.ZigbeeMode.ed.build.zigbee_mode=-DZIGBEE_MODE_ED
esp32h2.menu.ZigbeeMode.ed.build.zigbee_libs=-lesp_zb_api_ed -lesp_zb_cli_command -lzboss_stack.ed.trace -lzboss_stack.ed -lzboss_port
esp32h2.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
esp32h2.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32h2.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port
esp32h2.menu.ZigbeeMode.rcp=Zigbee RCP (radio co-processor)
esp32h2.menu.ZigbeeMode.rcp.build.zigbee_mode=-DZIGBEE_MODE_RCP
esp32h2.menu.ZigbeeMode.rcp.build.zigbee_libs=-lesp_zb_api_rcp -lesp_zb_cli_command -lzboss_stack.rcp -lzboss_port


##############################################################

esp32c6.name=ESP32C6 Dev Module
Expand Down Expand Up @@ -281,6 +302,12 @@ esp32c6.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
esp32c6.menu.PartitionScheme.rainmaker=RainMaker
esp32c6.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
esp32c6.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
esp32c6.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs
esp32c6.menu.PartitionScheme.zigbee.build.partitions=zigbee
esp32c6.menu.PartitionScheme.zigbee.upload.maximum_size=1310720
esp32c6.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
esp32c6.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
esp32c6.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
esp32c6.menu.PartitionScheme.custom=Custom
esp32c6.menu.PartitionScheme.custom.build.partitions=
esp32c6.menu.PartitionScheme.custom.upload.maximum_size=16777216
Expand Down Expand Up @@ -352,6 +379,19 @@ esp32c6.menu.EraseFlash.none.upload.erase_cmd=
esp32c6.menu.EraseFlash.all=Enabled
esp32c6.menu.EraseFlash.all.upload.erase_cmd=-e

esp32c6.menu.ZigbeeMode.default=Disabled
esp32c6.menu.ZigbeeMode.default.build.zigbee_mode=
esp32c6.menu.ZigbeeMode.default.build.zigbee_libs=
esp32c6.menu.ZigbeeMode.ed=Zigbee ED (end device)
esp32c6.menu.ZigbeeMode.ed.build.zigbee_mode=-DZIGBEE_MODE_ED
esp32c6.menu.ZigbeeMode.ed.build.zigbee_libs=-lesp_zb_api_ed -lesp_zb_cli_command -lzboss_stack.ed.trace -lzboss_stack.ed -lzboss_port
esp32c6.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
esp32c6.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32c6.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port
esp32c6.menu.ZigbeeMode.rcp=Zigbee RCP (radio co-processor)
esp32c6.menu.ZigbeeMode.rcp.build.zigbee_mode=-DZIGBEE_MODE_RCP
esp32c6.menu.ZigbeeMode.rcp.build.zigbee_libs=-lesp_zb_api_rcp -lesp_zb_cli_command -lzboss_stack.rcp -lzboss_port

##############################################################

esp32s3.name=ESP32S3 Dev Module
Expand Down Expand Up @@ -538,6 +578,9 @@ esp32s3.menu.PartitionScheme.esp_sr_16=ESP SR 16M (3MB APP/7MB SPIFFS/2.9MB MODE
esp32s3.menu.PartitionScheme.esp_sr_16.upload.maximum_size=3145728
esp32s3.menu.PartitionScheme.esp_sr_16.upload.extra_flags=0xD10000 {build.path}/srmodels.bin
esp32s3.menu.PartitionScheme.esp_sr_16.build.partitions=esp_sr_16
esp32s3.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
esp32s3.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
esp32s3.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
esp32s3.menu.PartitionScheme.custom=Custom
esp32s3.menu.PartitionScheme.custom.build.partitions=
esp32s3.menu.PartitionScheme.custom.upload.maximum_size=16777216
Expand Down Expand Up @@ -588,6 +631,13 @@ esp32s3.menu.EraseFlash.none.upload.erase_cmd=
esp32s3.menu.EraseFlash.all=Enabled
esp32s3.menu.EraseFlash.all.upload.erase_cmd=-e

esp32s3.menu.ZigbeeMode.default=Disabled
esp32s3.menu.ZigbeeMode.default.build.zigbee_mode=
esp32s3.menu.ZigbeeMode.default.build.zigbee_libs=
esp32s3.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
esp32s3.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32s3.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port

##############################################################

esp32c3.name=ESP32C3 Dev Module
Expand Down Expand Up @@ -682,6 +732,9 @@ esp32c3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
esp32c3.menu.PartitionScheme.rainmaker=RainMaker
esp32c3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
esp32c3.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
esp32c3.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
esp32c3.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
esp32c3.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
esp32c3.menu.PartitionScheme.custom=Custom
esp32c3.menu.PartitionScheme.custom.build.partitions=
esp32c3.menu.PartitionScheme.custom.upload.maximum_size=16777216
Expand Down Expand Up @@ -753,6 +806,12 @@ esp32c3.menu.EraseFlash.none.upload.erase_cmd=
esp32c3.menu.EraseFlash.all=Enabled
esp32c3.menu.EraseFlash.all.upload.erase_cmd=-e

esp32c3.menu.ZigbeeMode.default=Disabled
esp32c3.menu.ZigbeeMode.default.build.zigbee_mode=
esp32c3.menu.ZigbeeMode.default.build.zigbee_libs=
esp32c3.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
esp32c3.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32c3.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port
##############################################################

esp32s2.name=ESP32S2 Dev Module
Expand Down Expand Up @@ -868,6 +927,9 @@ esp32s2.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
esp32s2.menu.PartitionScheme.rainmaker=RainMaker
esp32s2.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
esp32s2.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
esp32s2.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
esp32s2.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
esp32s2.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
esp32s2.menu.PartitionScheme.custom=Custom
esp32s2.menu.PartitionScheme.custom.build.partitions=
esp32s2.menu.PartitionScheme.custom.upload.maximum_size=16777216
Expand Down Expand Up @@ -941,6 +1003,13 @@ esp32s2.menu.EraseFlash.none.upload.erase_cmd=
esp32s2.menu.EraseFlash.all=Enabled
esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e

esp32s2.menu.ZigbeeMode.default=Disabled
esp32s2.menu.ZigbeeMode.default.build.zigbee_mode=
esp32s2.menu.ZigbeeMode.default.build.zigbee_libs=
esp32s2.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
esp32s2.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32s2.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port

##############################################################

esp32.name=ESP32 Dev Module
Expand Down Expand Up @@ -1031,6 +1100,9 @@ esp32.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
esp32.menu.PartitionScheme.rainmaker=RainMaker
esp32.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
esp32.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
esp32.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
esp32.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
esp32.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
esp32.menu.PartitionScheme.custom=Custom
esp32.menu.PartitionScheme.custom.build.partitions=
esp32.menu.PartitionScheme.custom.upload.maximum_size=16777216
Expand Down Expand Up @@ -1118,6 +1190,13 @@ esp32.menu.EraseFlash.none.upload.erase_cmd=
esp32.menu.EraseFlash.all=Enabled
esp32.menu.EraseFlash.all.upload.erase_cmd=-e

esp32.menu.ZigbeeMode.default=Disabled
esp32.menu.ZigbeeMode.default.build.zigbee_mode=
esp32.menu.ZigbeeMode.default.build.zigbee_libs=
esp32.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator)
esp32.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api_zczr -lesp_zb_cli_command -lzboss_stack.zczr.trace -lzboss_stack.zczr -lzboss_port

##############################################################

esp32da.name=ESP32-WROOM-DA Module
Expand Down
2 changes: 2 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dependencies:
idf: ">=5.1"
mdns: "^1.1.0"
chmorgan/esp-libhelix-mp3: "1.0.3"
espressif/esp-zboss-lib: "^1.0.1"
espressif/esp-zigbee-lib: "^1.0.1"
esp-dsp: "^1.3.4"
espressif/esp_rainmaker: "^1.0.0"
espressif/rmaker_common: "^1.4.3"
Expand Down
4 changes: 2 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ build.code_debug=0
build.defines=
build.loop_core=
build.event_core=
build.extra_flags=-DARDUINO_HOST_OS="{runtime.os}" -DARDUINO_FQBN="{build.fqbn}" -DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.loop_core} {build.event_core} {build.defines} {build.extra_flags.{build.mcu}}
build.extra_flags=-DARDUINO_HOST_OS="{runtime.os}" -DARDUINO_FQBN="{build.fqbn}" -DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.loop_core} {build.event_core} {build.defines} {build.extra_flags.{build.mcu}} {build.zigbee_mode}
build.extra_libs=
build.memory_type={build.boot}_qspi

Expand Down Expand Up @@ -163,7 +163,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.extra_flags} {c
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"

## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {build.extra_libs} {compiler.c.elf.libs} {compiler.libraries.ldflags} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {build.extra_libs} {build.zigbee_libs} {compiler.c.elf.libs} {compiler.libraries.ldflags} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"

## Create partitions.bin
recipe.objcopy.partitions.bin.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin"
Expand Down
9 changes: 9 additions & 0 deletions tools/partitions/zigbee.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x140000,
app1, app, ota_1, 0x150000,0x140000,
spiffs, data, spiffs, 0x290000,0x15B000,
zb_storage, data, fat, 0x3EB000,0x4000,
zb_fct, data, fat, 0x3EF000,0x1000,
coredump, data, coredump,0x3F0000,0x10000,
10 changes: 10 additions & 0 deletions tools/partitions/zigbee_zczr.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x140000,
app1, app, ota_1, 0x150000,0x140000,
spiffs, data, spiffs, 0x28F000,0x15A000,
zb_storage, data, fat, 0x3EA000,0x4000,
zb_fct, data, fat, 0x3EE000,0x1000,
rcp_fw, data, spiffs, 0x3EF000,0x1000,
coredump, data, coredump,0x3F0000,0x10000,