TAG: firmware

Zigbee Switch Configurable Firmware (+Router)

This firmware allows you to create a Zigbee switch device with a flexible configuration of inputs and outputs. I’ve created a base firmware for CC2530, CC2530 + CC2590 , CC2530 + CC2591 and CC2530 + CC2592 chips. The attached configurator for Windows can write your device configuration to the selected base firmware. Then you can save the customized version to a separate HEX file and upload to your device.

Inputs and outputs can work independently. So you may create a switch without a control button, or a simple button only.

The device with this firmware also works as a router.

Note: the firmware is designed for constantly powered devices.


Fig.1 The configuration window

Remember state – The firmware saves the output state to NVRAM and restores it after power off/on.

Link – The input immediately controls the state of the corresponding output. The device sends the on/off state of the output to a coordinator. Otherwise, the input is independent.

Long – The firmware detects and reports to the coordinator a long click (2000 ms).

Double – The firmware detects and reports double click (max 500 ms between clicks).

Triple – The firmware detects and reports triple-click (max 500 ms between clicks).

Zigbee internals

  1. The firmware creates a separate endpoint (1..5) for every configured output and/or input (max 5 endpoints).
  2. The firmware reports the state of an independent button via the “ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC” cluster and the “PRESENT_VALUE” attribute. 1 – single click.
    2 – double click.
    3 – triple-click.
    4 – long click.
  3. The firmware does not send a separate report for the linked button. Otherwise, it sends reports about the output state via the “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster and the “ON_OFF” attribute.
  4. You may control the output state via the “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster and the “ON_OFF” attribute.
  5. The “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster also accepts the “read”, “configure” and “onOffWithTimedOff” commands: “read” – returns the current state on the specified endpoint.
    “configure” – set the periodic reporting interval for the output. The “minReportInt” attribute specifies the reporting interval in seconds. If “minReportInt” is 65535, the firmware disables periodic reports. “onOffWithTimedOff” – sets the output state to “HIGH” for “onTime” milliseconds, and automatically resets to “LOW”.


2019-08-14: Fixed bug with 3rd and 4th inputs.
2019-06-27: First release.


Download firmware

CC2530 + CC2590/CC2591/CC2592/RFX2401 routers

Nowadays, some manufacturers offer boards with additional power amplifiers for the radio signal. These boards may cover a rather large area than the regular CC2530. The standard router firmware does not work with these boards.

Example: EBYTE E18-MS1PA1-IPX

Therefore I’ve prepared particular versions:

The RFX2401 power amplifier has wiring identical to CC2590. Please, use the firmware for cc2530 + cc2590.

Your comments are welcome!


  1. These boards require a power supply with stable high output current (500mA). Double check cheap Chinese power sources.
  2. Double check the distance between pins or pin pads. For example, EBYTE board has 1.27 mm between pins. It is very hard to solder.

How to select and flash CC2530

How to select a CC2530 board

Ebay and Aliexpress offer several boards with the CC2530 chip (keyword: CC2530). You may select any board, but use the following criteria:

  1. The board must have the CC2530F256 chip (fig. 3). The key number here is 256 and it means 256 KB of flash memory. Most firmware was compiled for 256K memory.
  2. The board may have many pins or contacts. If you do not have a soldering iron then select a board with headers. I would suggest to select a board where each pin has the corresponding label. The label may slightly different on different boards: P0.2, P02, P0_2 are the same pin. The board must have at least the following pins:
    1. Po.2, Po.3, P2.0 – used for a UART interface. If you plan to use this board instead CC2531 and connect to your SBC like Raspberry Pi, then you need these pins. If you’ll upload a router firmware to this board then these pins are optional.
    2. P2.1, P2.2, RST – used for uploading firmware.
    3. GND – ground.
    4. Power source (VCC) – it may be 3.3V, 5V or both. This pin can be marked by VCC only. Internally, the CC2530 chip uses the 3.3V voltage, but a manufacturer may add a voltage regulator on the board and you may use any supported voltage (3.3V or 5V, no difference). Please, read a description for this board carefully about the voltage.
  3. The board may include an additional small chip (fig.5). Most likely, this is a wireless signal amplifier. Usually these boards contain “Long range”, “RF front-end”, “RF amplifier”, “CC2591”, “RXF2401” in a description. These boards require a special firmware. I would suggest to select this board if you really have a firmware for this combination of the main chip (CC2530) and the RF front-end chip.
  4. The board may contain an antenna on-board (fig.2, 3, 6) or a connector for an external antenna (fig. 1, 3, 4, 5). The board with an external antenna will work better in most cases.
  5. Some boards may have a metallic shield over the main chip and/or the RF front-end. This shield protects the board from radio noises (good). But I would suggest to buy this board from a trusted vendors only because you cannot be sure about chips under this cover.
  6. Rare CC2530 based boards may include an USB interface (fig. 6). CC2530 does not have native USB support apart from CC2531. Therefore a manufacturer adds an additional chip on the board. The additional chip implements the USB interface and the CC debugger. Therefore you can upload a firmware to this board without a special debugger (CC debugger or SmartRF04EB).  Therefore it holds small space on your work table. It can be useful for developers. If you need only one CC2530 or CC2531 for a coordinator role you may save money. Please, read a description for a board carefully because this USB interface and chip may be used for another purpose. Therefore I cannot recommend this board for beginners.
There are no more results.