A Flash Programmer for the CC2510
03/24/2018
An Arduino Uno Based Flash Programmer for the CC2510 System-on-a-Chip (SOC)
Early in 2018 a friend gifted me with a box of parts that included several CC2510 modules and a TI SmartRF 04DK Development Kit.
Sadly when I powered up the dev board it didn’t respond at all when plugged into the USB port of my PC I found some driver
software but that made no difference. Then I noticed the little paper tag attached to the bottom that read “Dead”.
Some of the other modules seemed OK but without a way to program them I was out of luck.
(click for larger image)
The collection of stuff sat by my desk for another month until I ran out of projects. I located a library for creating a CC2510 programmer with an Arduino
(https://github.com/wavesoft/CCLib) but it required a Python frontend and didn’t work for me
when I tried it. (Probably my fault) So using the library code as a guide along with a Debug
and Programming Interface Specification document I found, I began trying to communicate with
these chips. Communicating with the chip in debug mode was pretty straightforward and soon I
was able to read the chip ID and examine and update memory but programming a single byte of flash seemed to allude me. The examples in the documentation and used by the library code both relied on programming an entire page of flash memory but I knew I only wanted to program 16 bytes at a time
(the size of a standard .hex file record). The spec sheet indicated I should be able to program a
word, (2 bytes) of flash, by loading the address into FADDRH:FADDRL, setting a flag (FCTL.WRITE) then loading the data with two
consecutive writes to the “Flash Write Data Register”(FWDATA). This seemingly simple process had me stumped until I noticed this
in the spec. “Note that there exist a timeout period of 40us for writing one flash word to FWDATA”
So since each individual instruction executed through the debug interface must be transmitted serially, there’s no way to send
the instructions that set the flag and the two bytes of data within that 40us time frame.
This explained why the method recommended in the documentation involved uploading a small machine language program to the
chip's ram, uploading the page of data, and then sending the commands to execute the uploaded program which in turn would
program the flash. Once I figured this out I was able to slightly modify the program to program only the 16 bytes I wanted
(it will actually support up to 256 bytes but I’m fine with 16).
Once past that roadblock I kept looking at all the cool stuff on the (dead) development board (LCD, LEDs buttons, a joystick…).
I traced out some signals and found the Silabs USB controller chip to be dead. So I removed it from the board and added a couple of jumpers around signals it re-directed. Then I added a connector that would interface to my programmer in the same way it connected to the individual modules I had. Now I had access to all the goodies on the development board and I could program the chips without
removing the modules from the board.
So far I’ve just worked with the 8051 MCU on the chip and not the radio components.
Maybe when I once again run out of interesting projects I’ll take a look at that stuff…)
The code for this project as well as some datasheets are posted below.
The carrier I made because I didn't have the proper connectors for this module.
Bottom of the carrier (ugh...)
The Module in my homemade carrier.
TI SmartRF 04DK Development board
Development board connected to the programmer
The box also had a few of these custom boards.
Here's a link to the CC2510 datasheet: https://www.ti.com/lit/ds/symlink/cc2510.pdf
and the Debug and Programming Interface: www.ti.com/lit/ug/swra124/swra124.pdf
SDCC compiler will work with CC2010: http://sdcc.sourceforge.net/
Download Link Details:
CCDebug.zip Source code for the programmer
(Note intended for compiling with WinAVR not the Arduino IDE. Modify AVRDUDE_PORT to match your Uno
COM port value and then just enter MAKE program to compile & upload)
CCpgmr.zip Source, executable and CodeBlocks project for the PC utility that uploads .hex file to the programmer.
blink1.zip Source and .hex for simple CC2510 test program that increments the low 4 bits of P1.
this archive also contains source and .exe for modified packihex.exe. (Replace the one that ships with SDCC)