Getting Started - TUMeshNet/contiki GitHub Wiki
Flashing Guide for Openmote–CC2538
Flashing via the BSL script (works for Linux, Mac, Windows) There are links in the Openmote platform directory in Contiki github. Download the TUMESH contiki source files as those contains the updated BSL upload codes.
Equipment needed: Openmote-cc2538 Openmote-Openbase or USB explorer for serial port connection
Install a Toolchain In order to build Contiki, an ARM-GCC toolchain is needed. A link is provided in the Openmote platform directory in the Openmote platform directory in the contiki github.
- Install the GNU ARM Embedded Toolchain for your Operating System and make sure to include the Path to the bin file for universal access.
- Verify that it is installed correctly: $ arm-none-eabi-gcc –version arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848] Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Flashing the Hardware:
- Do this only if the device is brand new or still contains the boot loader. If the device was already flashed with an invalid image or the boot loader was not set, the device must be flashed using a SEGGAR in the next section with a valid image such as the Openmote-demo.
- Plug in the Openmote-cc2538 device to the USB explorer/Openbase
- Enter the Openmote-cc2538 device into bootloader mode. Make a connection between the GND pin and the ON pin and click reset. If done correctly the Openmote-cc2538 should light up all the LED bright and stay that way.
- Traverse to the Openmote example in the Contiki directory in terminal.
- First, create a save target for the platform the file will build to by entering: $ make TARGET=openmote-cc2538 savetarget
- Next create the binaries by entering: $ make
- To upload the file enter: make .upload $ make openmote-demo.upload
- If successful, the output should be something like this:
Opening port /dev/tty.usbserial-A5043CQ6, baud 115200
Reading data from hello-world.bin
Cannot auto-detect firmware filetype: Assuming .bin
Connecting to target...
CC2538 PG2.0: 512KB Flash, 32KB SRAM, CCFG at 0x0027FFD4
Primary IEEE Address: 06:0D:9B:6A:00:12:4B:00
Erasing 524288 bytes starting at address 0x00200000
Erase done
Writing 516096 bytes starting at address 0x00202000
Write 8 bytes at 0x0027FFF8F00
Write done
Verifying by comparing CRC32 calculations. Verified (match: 0xe85fe823) - Verify the hardware is correctly flashed by hitting reset. You should see the demo running and the LEDs blinking.
Manuel Hardware Flashing: For examples that the make file isn’t defined, flashing the hardware can be done manually.
- Build the target: $ make TARGET=openmote-cc2538
- Make sure the path to the BSL script in the contiki/tools/cc2538 is correct for your file location and upload the files by entering the following code and the corresponding bin file for that example: $ sudo python ../../tools/cc2538-bsl/cc2538-bsl.py -e -w --bootloader-active-high -b 115200 -v -a 0x00202000 openmote-upload.bin
Flashing via the SEGGAR (works for Linux, Mac) https://texus.me/2016/01/25/debugging-openmote-CC2538-with-jlink-using-nemiver/ Link to SEGGAR software can be found in there
Equipment needed: Openmote-cc2538 Openmote-Openbase SEGGAR Adaptor for SEGGAR
Install a Toolchain In order to build Contiki, an ARM-GCC toolchain is needed. A link is provided in the Openmote platform directory in the Openmote platform directory in the contiki github.
- Install the GNU ARM Embedded Toolchain for your Operating System and make sure to include the Path to the bin file for universal access.
- Verify that it is installed correctly: $ arm-none-eabi-gcc –version arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848] Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The SEGGAR software be can download for both Linux and Mac. To start the software in: • Linux – Execute the following command $ JLinkGDBServer -device CC2538SF53 • Mac – Locate the JLink executable and run that
Process for uploading:
- Excecute the JLink Server executable
- In another terminal traverse to the example Openmote-demo and create a file named cc2538.gdb with the following: target remote localhost:2331 monitor interface JTAG monitor endian little monitor speed auto monitor flash device = CC2538SF53 monitor flash breakpoints = 1 monitor flash download = 1 monitor reset load continue
- Make the target file by entering $ make TARGET=openmote-cc2538
- To flash the hardware, the .elf file must be entered with the following command arm-none-eabi-gdb --batch --command=cc2538.gdb openmote-demo.elf
- On the terminal with the JLink server, it should say downloading to registers.
- After flashing is complete, hit the reset button on the Mote and it should run the demo.
Troubleshooting: If it seem that the files did not flash, repeat the process with the commands arm-none-eabi-gdb --batch --command=cc2538.gdb openmote-demo.elf It will say that there was an error reading the register but it has successfully uploaded.