Flashing firmware via Arduino is implemented using the project https://github.com/wavesoft/CCLib
**But with minor improvements!!!**
[AndrewLinden](https://github.com/AndrewLinden) described that he was able to flash CC2531 using CCLib [with comments](https://github.com/wavesoft/CCLib/issues/19).
As described [I made a fork of the CCLib library with minor changes](https://github.com/kirovilya/CCLib) for flashing firmware via Arduino:
* Timeouts of operations
* After opening the port (I have in Windows 7) Arduino reboots and, accordingly, does not respond to requests - made a 3 seconds pause (found somewhere in internet).
* The port speed is reduced to 9600, because at another speed leaving communication errors:
`ERROR: Could not read from the serial port!`
Flashing proccess:
1. Download and unpack the archive with the library https://github.com/kirovilya/CCLib.
**If flashing via esp8266 (wemos d1 mini), you need change connection (p. 5) and Pinout configuration in Arduino/CCLib/Examples/CCLib_proxy/CCLib_proxy.ino:**
```
int CC_RST = 5;
int CC_DC = 4;
int CC_DD_I = 14;
int CC_DD_O = 12;
```
3. Install Python 2.7 or later (tested with python 2.7.13), if not installed
4. Install pyserial 3.0.1, if not installed
`pip install -r CCLib\Python\requirements.txt`
or
`pip install pyserial==3.0.1`
5. Connect the contacts as described https://github.com/kirovilya/CCLib#1-prepare-your-arduino-board
**But in my case, I connected completely without resistors, combined the contacts CC_DD_I and CC_DD_O together and connected to the DD pin of the DEBUG connector!**