forked from bewest/mmblelink
-
Notifications
You must be signed in to change notification settings - Fork 47
Writing CCTL Firmware to the ERF stick
Oskar Pearson edited this page Feb 14, 2016
·
4 revisions
If you have an existing CCTL-based firmware on the ERF stick, you can upgrade the ERF stick without a CC-debugger.
In all examples below, the serial device used is /dev/ttyMFD1, which is the serial port on the Edison.
If you're using a Raspberry Pi, the serial device is /dev/ttyAMA0. You will need to stop other devices using the device, as per http://www.hobbytronics.co.uk/raspberry-pi-serial-port
cd /tmp/
curl -L -O https://github.com/ps2/subg_rfspy/releases/download/v0.6/uart0_alt1_SRF_ERF_US_CCTL.hex
# OR FOR NON-USA:
curl -L -O https://github.com/ps2/subg_rfspy/releases/download/v0.6/uart0_alt1_SRF_ERF_WW_CCTL.hex
git clone https://github.com/ps2/subg_rfspy.git
git clone https://github.com/oskarpearson/cctl.git
cd cctl
git checkout 24mhz_clock_and_erf_stick_hack
cd cctl-prog
make
Which should display something like:
gcc -o cctl-prog -Wall cctl-prog.c hex.c
We need to reset the ERF device, so that it runs the CCTL firmware, and then immediately write the new firmware:
$ export RFSPY_RTSCTS=0
$ /tmp/subg_rfspy/tools/reset.py /dev/ttyMFD1 ; ./cctl-prog -d /dev/ttyMFD1 -f /tmp/uart0_alt1_SRF_ERF_US_CCTL.hex
# OR FOR NON-USA:
$ /tmp/subg_rfspy/tools/reset.py /dev/ttyMFD1 ; ./cctl-prog -d /dev/ttyMFD1 -f /tmp/uart0_alt1_SRF_ERF_WW_CCTL.hex
This should display something like this:
Waiting 10s for bootloader, reset board now
..Bootloader detected
Erasing, programming and verifying page 1
Erasing, programming and verifying page 2
Erasing, programming and verifying page 3
Erasing page 4
Erasing page 5
...
Erasing page 31
Programming complete
You can then test to check the version is correct:
$ export RFSPY_RTSCTS=0
$ /tmp/subg_rfspy/tools/get_rfspy_version.py /dev/ttyMFD1
RileyLink OK
Version: subg_rfspy 0.6
Response: subg_rfspy 0.6