View Categories

Zigbee stick CC2531 firmware programming

Zigbee
Zigbee USB stick CC2531 met antenne 02

Flashing Z-Stack on a CC253x with only a Raspberry Pi

From a software point of view, you would need to have WiringPi installed and have the according coordinator or repeater firmware ready. This will be explained in the later process.

Default stick firmware

Linux dmesg:

usb 1-1.1: new full-speed USB device number 12 using xhci_hcd
usb 1-1.1: New USB device found, idVendor=0451, idProduct=16ae, bcdDevice=90.72
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.1: Product: CC2531 USB Dongle
usb 1-1.1: Manufacturer: Texas Instruments

Windows device manager:

Pinout USB stick and connect debugger PCB #

Zigbee USB stick CC2531 pinout 02

Connect to Raspberry Pi #

Using a CC PCB connector:

Programmer verloop kabel module voor CC2531 CC2540 USB sticks 02

You can power the USB via the USB port, or connect 3V3 to VCC

Raspberry PiCC2531
3V3VCC -target
GNDGND
Pin 38DD
Pin 36DC
Pin 35RST

Connect to Orange Pi #

Using a CC PCB connector:

Programmer verloop kabel module voor CC2531 CC2540 USB sticks 02
oplus_0

You can power the USB via the USB port, or connect 3V3 to VCC

Orange PiCC2531
3V3VCC -target
GNDGND
Pin 19 (wPi 12)DD
Pin 21 (wPi 13)DC
Pin 23 (wPi 14)RST

Install WiringPi #

For CC programmer you need to install wiringpi:

sudo git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi
./build
cd..

https://github.com/WiringPi/

Icoon

WiringPi #

4 bestand(en) 505.67 KB

Install CC flash software #

Install CC flash software as follows:

git clone https://github.com/jmichault/flash_cc2531.git
cd flash_cc2531

https://github.com/jmichault/flash_cc2531

Download Z-stack firmware #

Download the firmware “stack home 1.2” with wget and unzip

sudo wget https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20211115.zip
sudo unzip CC2531_DEFAULT_20211115.zip

https://github.com/Koenkk/Z-Stack-firmware

Icoon

CC2531_DEFAULT_20211115.zip #

1 bestand(en) 325.04 KB

it will unzip two files:

  inflating: CC2531ZNP-Prod.hex
  inflating: CC2531ZNP-Prod.bin

Flashing Z-stack firmware on the stick using Raspberry Pi #

Check the connection

sudo ./cc_chipid

This should now contact the CC2530 board and return the chip id. If this return something like 0000 or ffff you have to go back and check the wiring! The result should be

ID = b524.

Note: Usually you will find an expected result of “a524” on the internet. This is also a valid result, but for the USB stick type of hardware. In case you are having a CC2531, you will get „a524“ as a result.

First erase the contents with the command:

sudo ./cc_erase

The output will be like:

  ID = b524.
  erase result = 00a2.

Now flash the firmware with the command (will take about 2 minutes):

sudo ./cc_write CC2531ZNP-Prod.hex

The output will be like:

  ID = b524.
  reading line 15490.
  file loaded (15497 lines read).
writing page 128/128.
 flash OK.

Flashing Z-stack firmware on the stick using Orange Pi #

Since the CC programmer is not connected on the default pins, we have to

You can run the gpio command to view the table:

sudo gpio readall

There you will find the wPi pin numbers:

You can give commandline parameters for the pins you have used, see below.

Check the connection

sudo ./cc_chipid -r 14 -c 13 -d 12

This should now contact the CC2530 board and return the chip id. If this return something like 0000 or ffff you have to go back and check the wiring! The result should be

ID = b524.

Note: Usually you will find an expected result of “a524” on the internet. This is also a valid result, but for the USB stick type of hardware. In case you are having a CC2531, you will get „a524“ as a result.

First erase the contents with the command:

sudo ./cc_erase -r 14 -c 13 -d 12

The output will be like:

  ID = b524.
  erase result = 00a2.

Now flash the firmware with the command (will take about 2 minutes):

sudo ./cc_write CC2531ZNP-Prod.hex -r 14 -c 13 -d 12

The output will be like:

  ID = b524.
  reading line 15490.
  file loaded (15497 lines read).
writing page 128/128.
 flash OK.

After updating the firmware #

After updating the firmware you will notice thet the stick is detected as follows:

Linux dmesg:

usb 1-1.1: new full-speed USB device number 15 using xhci_hcd
usb 1-1.1: New USB device found, idVendor=0451, idProduct=16a8, bcdDevice= 0.09
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1: Product: TI CC2531 USB CDC
usb 1-1.1: Manufacturer: Texas Instruments
usb 1-1.1: SerialNumber: __0X00124B000E898134
cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

Windows device manager:


Products #


Source #

https://lemariva.com/blog/2019/08/zigbee-flashing-cc2531-using-raspberry-pi-without-cc-debugger

https://jmichault.github.io/flash_cc2531-dok/eo

https://blog.boris-wach.de/permalink/265