ksjh / silabs-firmware-builder

Silicon Labs firmware builder
13 stars 2 forks source link

Multiprotocol firmware for the ZB-GW03/SM-011 #8

Open fhloston opened 1 year ago

fhloston commented 1 year ago

Is it possible to use a multiprotocol firmware with the ZB-GW03?

"The Silicon Labs EFR32MG21 based Zigbee SiP radio module it uses is the exact same “SM-011 V1.0” modules and Zigbee firmware by CoolKit-Technologies 21 that ITead Sonoff ZBBridge board uses."

ksjh commented 1 year ago

Please do not use any of the provided firmware files until somebody has checked which port and pins of the EFR32MG21 are connected to the serial port pins (TX, RX, CTS, RTS). Some of the integrated Zigbee bridges also normally use firmware that also includes an updated bootloader. My files here do not contain the bootloader part. When generating firmware with bootloaders, it is also necessary to check which pins are used to activate the bootloader on startup. Once this is clear, I can try to provide adapted files, but we need more information first.

fhloston commented 1 year ago

I'll try to collect infos here.

From https://github.com/syssi/esphome-zb-gw03/blob/main/packages/core.yaml

GPIO02 Zigbee Tx

GPIO04 Zigbee Rx

SM-011 V1.0 nRST

As far as I understand https://github.com/xsp1989/zigbeeFirmware provides signed firmware for these modules but i do not see patches or sources.

ksjh commented 1 year ago

Thank you, this is quite helpful.

But I see that the firmware is signed. We also need to find out how somebody could sign sign the ota files. Is this process documented somewhere? I suppose, valid signing keys are not publicly available.

fhloston commented 1 year ago

Currently I do not yet understand where the signature enforcement is done - I suspect the bootloader though.

Can't the bootloader be replaced? To my understanding these modules are all quite similar.

ksjh commented 1 year ago

I have to read more about the update process of this module, but on the web page you mentioned, I see that some versions of the bootloader need signed firmware, others do not. So, in theory, it could be possible to update not only the application, but also the bootloader, I do not know, if this is possible here. But, nonetheless, the first update package (ota) that might possibly be able to update the bootloader would still need to be signed itself.

darkxst commented 1 year ago

But I see that the firmware is signed. We also need to find out how somebody could sign sign the ota files. Is this process documented somewhere? I suppose, valid signing keys are not publicly available.

I believe xsp1989 used to work for iTead or something, that is why he has the keys.

You possibly will need to use SWD/JTAG to replace bootloader.

darkxst commented 1 year ago

Is it possible to use a multiprotocol firmware with the ZB-GW03?

The Silicon Labs Multiprotocol Add-on would also need to support connecting to a remote dongle over TCP. I have no idea if it does though I don't expect this is a scenario that NabuCasa would be testing.

ksjh commented 1 year ago

Thank you. This was my impression also. I read a bit about this problem. I will see what I can come up with. I have ordered some similar modules. Once they arrive from China, I will try how far I can get with pyOCD and a DAPLink probe or possibly another JTAG probe. The advantage of both the ZBBridge and the ZB-GW03 is that the programming pins are alread routed to through-hole pads, so soldering a pin header would be easy.

ksjh commented 1 year ago

Yes, the Silicon Labs Multiprotocol add-on would need to connect to the adapter over TCP. I am also not sure the RCP part works well, since the lower layer packets need to be processed by the zigbeed in software on the host. And there is a TCP connection in between. This might lead to performance issues, not sure about the timing requirements here. But, at least, we could try it, perhaps using socat, once we managed to flash the necessary firmware. If you want to try this earlier, you could also use a ZB-GW04 or a ZBDongle-E, where it is easy to flash the required RCPMultiPAN firmware, connect it to a separate host (a pi would do), and use something like ser2net to make the (USB) serial port available remotely.

fhloston commented 1 year ago

Is it possible to use a multiprotocol firmware with the ZB-GW03?

The Silicon Labs Multiprotocol Add-on would also need to support connecting to a remote dongle over TCP. I have no idea if it does though I don't expect this is a scenario that NabuCasa would be testing.

It already does :)

image

darkxst commented 1 year ago

This might lead to performance issues, not sure about the timing requirements here.

ZBBridge over WiFi likely be problematic, Ethernet of ZB-GW03 should be better.

darkxst commented 1 year ago

It already does :)

Interesting, I've not seen that on my installation (v1.0.2) of the add-on.

fhloston commented 1 year ago

It is hidden by default with the "Show unused optional configuration options" switch at the bottom.