Riprogram the firmware of the CC2531 USB dongle via Raspberry Pi and without CC Debugger

3 minutes of reading
  • Riproedit the firmware of a CC2531 USB dongle (in the example we will use the version required for use with zigbee2mqtt)
  • Difficulty level: bass
  • Riprofirmware grammation

All environments

Notes and disclaimer
  • qualsiasi eventuale modifica agli impianti domestici dev'essere progettata ed realizzata SOLO da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.
Driving review: 1.1


Every electronic device contains broadly a small piece of softwareCalled firmware, which determines its functions and behavior. Our car is equipped with different firmware; it has one, the washing machine, our remote control, even a clock radio has a profirst firmware.

Il CC2531 USB dongle it's a small and inexpensive component which allows, combined with the software zigbee2mqtt, to define a BRIDGE/Gateway ZigBee↔︎MQTT useful for administering a network ZigBee in profirst personal home automation (and therefore accessories based on this standard); unfortunately, the component is not pronto use (as, differently, other similar components like the ConBee, which however cost more) but provides, upstream, for a reprogrammation of its firmware in order to make it operational.

This guide illustrates one of the ways of reprogrammation through a Raspberry Pi support (any model) and without the need for connection devices such as the CC Debugger and the download cable for CC2531. In case you own these components - or prefer this other technique regardless because you don't have a Raspberry Pi - the guide appropriata è this.

The guide is obviously usable also with other firmware compatible with CC2531.

It starts

Description proprocedure

La proprocedure it's really a lot, very simple. It is in fact sufficient to connect four contacts present on the CC2531 USB dongle with as many four present on the Raspberry Pi (any model, even Pi Zero), then connect the dongle to one of the USB ports of the Raspberry Pi and finally execute a specific command.

What you need to have is:

Physical connections

First of all it is necessary to connect the two devices respecting the following scheme:

PIN CC2531withPIN Raspberry Pi

Contacts to be interconnected via Dupont cables are the following:

ATTENZIONE: the scheme for Raspberry Pi reports that of the Raspberry 2 / 3 / 4, but the pinout is the same even on Raspberry Pi Zero

Once the pins are connected together insert the CC2531 USB dongle to one of the Raspberry USB ports, after that connect via SSH to profirst Raspberry. In case it was off, prosee to turn it on.



First of all it is necessary to check the presence of the software WiringPi. To perform this verification, from the terminal (once connected to the Raspberry via SSH), execute the following command:

gpio -v

Which should provide an answer similar to the following:

gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

once this response is obtained, you have confirmation that you have the necessary software on board.
In case instead get an error, it will then be necessary to install the software using the command:

sudo apt-get install wiringpi
INSTALL flash_cc2531

Now you need to install the software flash_cc2531 using the command:

git clone

Once the brief installation is complete, access the "flash_cc2531”And execute the verification command:

cd flash_cc2531

In response, the command should provide the ID "b524". If it is different, check connections.


At this point it is necessary to download the firmware that we are interested in installing on the C2531 USB dongle. In the example below we will install the firmware Z-Stack (the most compatible and stable with zigbee2mqtt), available here. The file that interests us begins with the prefix "CC2531_DEFAULT_“, While the prefix varies with respect to the compilation date.

Run then:

cd ~/flash_cc2531

taking care to adjust the command based on the name of the file available on the repository

Example: with file name "", The final command is:


Finally, run the unzip:


always adapting the file name.


Now we can execute the two commands necessary for the riprogrammation, the first to erase the dongle's memory and the second to rewrite itproprogram:

./cc_write CC2531ZNP-Prod.hex

Finished the procedura, the CC2531 USB dongle will be pronto use with zigbee2mqtt.


To finish the procedura, disconnect the dongle from the USB port and then disconnect the Dupont cables.


Stay up to date through ours Telegram channel!