contiki-os/contiki — pull request #551 by JelmerT (2014-02-02 01:31:26+00:00)
Title: CC2538 serial boot loader python script

After being fed up with SmartRF Flash Programmer 2 and Uniflash, both running in virtual machines on OSX with not too much memory, I wrote a cross platform python script to upload firmware to the serial boot loader of the cc2538.

###### Advantages:
* Python, should work on all OSes
* Serial boot loader means you just need a USB to uart converter (cable/chip) to program a cc2538 platform (arduino-style). This is much cheaper than a jtag programmer and might in turn enable more and simpeler dev platforms based on this SoC. Which results in more Contiki users, and makes everyone happy.
* No external program needed for code upload. Much easier dev cycle.
* Contiki development on native OSX

###### Disadvantages:
* You need to make sure the boot loader backdoor is enabled or you might lock yourself out.
* You need to manually reset and enable the boot loader on each upload.
* No multiple node uploading yet.

In this request I enabled the boot loader backdoor for the CC2538DK: you need to hold down the select button while resetting to force the boot loader to start. The buttons are on opposite sides of the board, but you can still do it easily with one hand. As far as I can tell enabling the boot loader backdoor doesn't obstruct the current workflow, except if you randomly push the select button on the DK while resetting.
I also updated the cc2538dk makefile, a simple .upload (and manual reset) will automagically send your code to the DK.

To test this code you'll need a blank cc2538, otherwise the boot loader won't start, so you'll need to wipe it once with a jtag programmer.

There is also a Readme included for the cc2538-bsl and an update to the platform Readme.

I only tested this on OSX, I don't expect much trouble on Linux, it does need some testing on Windows, and mainly the automatic serial port detection.