The CC2538DK is Texas Instruments' developer kit for the CC2538 SoC MCU, which combines an ARM Cortex-M3 microcontroller with an IEEE802.15.4 radio.
- CC2538: 32-bit Arm Cortex-M3 Zigbee, 6LoWPAN, and IEEE 802.15.4 wireless MCU with 512kB Flash and 32kB RAM
MCU | CC2538SF53 |
---|---|
Family | ARM Cortex-M3 |
Vendor | Texas Instruments |
RAM | 32KiB |
Flash | 512KiB |
Frequency | 32MHz |
FPU | no |
Timers | 4 |
ADCs | 1x 12-bit (8 channels) |
UARTs | 2 |
SPIs | 2 |
I2Cs | 1 |
Vcc | 2V - 3.6V |
Datasheet | Datasheet (pdf file) |
Reference Manual | Reference Manual |
When you first got the CC2538DK, it is in the ship mode(locked out), The bootloader will be normally executed directly after reset, if there is no valid image exists in the flash. If you want to flash your own firmware, you need to unlock the backdoor first.
- Using Ti Flash Programmer to change the value at address
0x27FFD7
to0xF3FFFFFF
- Holding down the
select
button while pushing theEM reset
button before flash
sudo modprobe ftdi_sio vendor=0x403 product=0xa6d1
# switch to the root user
echo 0403 a6d1 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
Note: Holding down the select
button while pushing the EM reset
button before flash
For open source codes, using cc2538-bsl to flash the firmware.
-
RIOT:
python /path/to/cc2538-bsl/cc2538-bsl.py -p "/dev/ttyUSB<x>" --write-erase -v -b 460800 /path/to/<firmware>.bin
-
Contiki-NG:
python /path/to/cc2538-bsl/cc2538-bsl.py -e -w -v -a 0x00202000 /path/to/<firmware>.bin
If cc2538DK export /dev/ttyUSB0 and /dev/ttyUSB1, remember to use /dev/ttyUSB1
XDS100v3 is a on-board debugger, to enable debugging without external debugger.
- download the TI GDB server/agent via XDS simulation
- The GDB server is in
/path/to/ti/common/uscif/gdb_agent_console[.exe]
- Download the AN128 which contain the dat file for debug
- unzip the downloaded AN128 zip, the dat file is
CC2538_XDS100v3c2_linux.dat
- open the gdb server using command:
/path/to/ti/common/uscif/gdb_agent_console /path/to/AN128/CC2538_XDS100v3c2_linux.dat
-
connect JLink/JTag with the J-TAG 20-pin header on the cc2538dk (SmartRF06) boards
-
open
JLinkGDBServer
in one session
JLinkGDBServer -device CC2538SF53 -endian little -if JTAG -port 2331
- open gdb in another session and connect gdb server thourgh 2331 port
arm-none-eabi-gdb <firmware.elf> -ex 'target remote :2331'
Make sure use JTAG as target interface in Connection Settings of Ozone
NOTE!!! Contiki-NG use cc2538's watchdog timer by default, debugging will trigger watchdog's timeout, causing the system to reboot, so Contiki-NG can only be debugged after commenting out the watchdog code.