This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2538: Thread on the CC2538

Part Number: CC2538

I am starting to put the openThread stack on the CC2538

About me - I have read the Thread v1.1.0 specification, I'm a former ZigBee developer and contributor to some of the ZigBee specs.

Plan:

    I will be using a custom Schneider board that looks very much like the CC2538 Evaluation Module Kit except this has the cJTag port on it and the 6 pins for the UART on it.

    Initially I've compiled the openThread Stack on a InstantContiki3.0 VMware image and created the hex file from the output .elf file on Linux.

    I intend to use the SMARTRF06EBK-SmartRF06 Evaluation Board as my programmer and debugger using it's 10 pin compact JTag connection.

Questions:

Has anyone else already done this?

I would eventually like to move all my development to Windows.  Has anyone compiled the openThread stack on windows?  Where you able to import the project into any IDEs on Windows?

Has anyone gotten a debugger working and been able to set break points and step through the code?

Does anyone have traces of Thread traffic and a trace viewing program they would recommend?

Thanks

Jonathan

  • Hey Jonathan,

    I don't see any problem with flashing that board over cJTAG. For my development I've been using the SmartRF06 with a cc2538em, which uses the JTAG from the XDS100v3.

    I would recommend that you keep using a Linux VM to build the ELF files. This is the easiest way to make sure you can get the latest updates from OpenThread. I use an almost stock Ubuntu 14.04 LTS image to build OpenThread. The only additions I had to make were installing pexpect, downloading an arm embedded compiler, and installing doxygen. But if the Contiki image works for you, I'd keep using it.

    Currently there are no IDEs to build and run OpenThread. If you are really determined, I believe you could get the Automake build system to work under a Cygwin or MinGW system on Windows.

    You can get CCS to download and debug the ELF built with Automake and GCC. Unfortunately I do not have a good getting started guide to point you to, but the steps are:

    1. Open CCS with a new blank workspace
    2. Create a Target configuration for your board
      1. go to "View -> Target Configurations"
      2. right click in the Target Configurations window and select "New Target Configuration"
      3. Put in a useful name and click finish
      4. Configure your Target Configuration, make sure to set the Connection and Board or Device
    3. Create a Debug Configuration
      1. go to "Run -> Debug Configurations..."
      2. select the code composer studio icon in the left pane, right click and select New
      3. Give it a useful name
      4. in "main -> Target Configuration" find the Target Configuration you created above
      5. in "program -> Program" select the elf file you created, this will have been in `openthread/output/bin`
      6. in "source -> Add -> Path Mapping" add a mapping from where the source is in your Virtual Machine to where it is on your host machine
    4. Start Debugging by clicking the Debug button in the "Debug Configurations..." dialog
    5. Select the connection in the Debug pane and click the Connect Target icon
    6. You may have to load the program again to get the symbols into the debugger

    You should now be able to step through the code and set breakpoints. Now you can rebuild with OpenThread's build system, and download and debug with CCS.


    I don't have a trace on hand right now, but the next time I spin up my Thread network I'll update this thread with a packet capture. I use Ubiqua to sniff traffic, it has a very nice Thread packet dissector. I have not used Wireshark but OpenThread has instructions on how to use their NCP with Wireshark.

    Hope that helps,

    Seth

  •  

    Here some capture files of a simple OpenThread Network starting up. This is without commissioning.

    Seth

    basic_thread_startup.zip

  • Thank you for the capture files. Do you have anymore? I should have my stuff up and running by the weekend but it is nice to have more than one source. I'm also going back through the standard and taking notes. Reading the standard it is not entirely clear how the layers are done. It is obvious from looking at the traces though.

    Jonathan
  • This is a capture from some work today. It is of a sleepy end device connecting to a parent and pinging.

    sleepy_end_device.zip

    For the most part, the networking layers are the same as 6LoWPAN. The other layers of the Thread protocol are up at the IPv6 Application Layer. MLE is based on CoAP and secure CoAP.

    Seth