Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
programming [2016/02/03 18:23]
raffael [Known issues]
programming [2016/05/22 12:47] (current)
sam
Line 1: Line 1:
-====== Getting started with programming Octanis 1 using CCS on any OS ====== +[[orb:​programming|this page has moved to orb:programming]]
-CCS is TI's custom eclipse based IDE for MSP43x and other MCU. It includes nice debugging tools and it is a working all-in-one development system. The free version using the TI compiler is code-size limited for MSP43x devices, but you can use the GNU compiler with unlimited code size within CCS. For the MSP432, TI-RTOS is even supporting the GNU compiler, in contrast to MSP430 devices.  +
- +
-The following describes how to get CCS up and running: +
-  - Download CCS [[http://​www.ti.com/​tool/​ccstudio|here]]. It's free, but TI-Account required. +
-  - In the application,​ you have to add TI-RTOS for MSP43x and MSP43xWare depending on your MCU, in the app center. +
-  - Get started with examples (Help -> Welcome. Then "​Browse Examples"​) or: +
-  - Import the project for the mainboard firmware from [[https://​github.com/​Octanis1/​Octanis1-Mainboard-Firmware_MSP_EXP432P401RLP|GitHub]]. It should compile and build directly (if not: check the [[programming#known issues|known issues]]) +
- +
-To get more info about the pin connections of the mainboard:​ +
-  - Our wiki page on the mainboard firmware: http://​octanis.org/​wiki/​octanis1/​main-board +
-  - The PCB files can be found on GitHub: https://​github.com/​Octanis1/​Octanis1-Electronics (the current mainboard is version 0.5, the external sensor extension is called external_weather_strip) +
- +
-More info on programming:​ +
-  - [[http://​www.ti.com/​lit/​pdf/​spruhu5|TI-RTOS getting started guide]] +
-  - [[http://​www.ti.com/​lit/​spruhd4|Users guide for TI-RTOS 2.14]] +
-  - [[http://​www.ti.com/​lit/​ds/​slas826a/​slas826a.pdf|Datasheet of the MSP432]] +
- +
-===== Target Configuration:​ Different between launchpad and external MCU ===== +
-In the Project Tree --> targetConfigs open the file "​MSP432P401R.ccxml"​. There, under "​Advanced Setup",​ Click on Target Configuration. Click on "Texas Instruments XDS110 USB Debug Probe" in the tree and you will see this screen: +
- +
-{{ :​targetconfig.png |}} +
- +
-If you flash the mainboard, i.e. you use the JTAG connector of the launchpad for an **external device**, leave the settings as in the pictures (SWD mode settings: Use SWD Mode with SWO Trace enabled) +
- +
-If you flash the **MCU on the launchpad** change the SWD mode settings to: Use 1149.1 JTAG, SWD Mode with is disabled. +
- +
-===== Flashing the mainboard (v0.5) ===== +
- +
-**IMPORTANT** When trying to flash the mainboard, make sure to connect the JTAG cable in the correct way. The 3.3V supply cable (usually marked red) has to connect to the uppermost pin on the JTAG header on the mainboard as shown in the figure below. +
- +
-Also, remove all jumpers that connect the programmer with the MSP432 on the launchpad. Finally, move the JTAG switch to Ext. Debug. +
-{{ :flashing_mainboard.jpg?​600 |}} +
- +
-===== Factory reset in CCS for the MSP432 ===== +
- +
-(from this e2e [[https://​e2e.ti.com/​support/​microcontrollers/​msp430/​f/​166/​p/​456120/​1652269#​1652269|forum post]]+
- +
-  - Connect the failing LaunchPad/​unit to your PC. +
-  - Open CCS, assume you already have at least one MSP432 project open. +
-  - Go to View > Target Configuration. +
-  - Within Target Configuration navigate to your MSP432 project > the .ccxml file. +
-  - Right Click > Launch Configuration +
-  - Under Debug window you should now see some tree structure starting with the .ccmxl file being the root > something_CORTEX_M4_something (unknown) +
-  - Right Click > Show all hidden cores. +
-  - Connect only to the Non-Debuggable Devices > DAP. +
-  - Go to Script > Factory Reset. +
-  - Power cycle and try to restart debug. +
-===== Known issues ===== +
-=== driverlib.h is not existing/​found === +
-When importing the project on Windows and Linux with a probably newer verision of CCS/MSPWare than for Mac OS, there are some issues with the path names.  +
-First of all, make sure you installed MSP430xWare. +
- +
-Then, right-click on the project root directory, click "​Properties"​ and adapt the path as in the screenshots below (40c for Windows/​Linux users instead of 40a for Mac users). +
- +
-IMPORTANT: As we are multiple users with multiple OS working on the code, these changes should not be tracked in the git repository. To do this, type: +
- +
-<​code>​ +
-git update-index --assume-unchanged .cproject +
-git update-index --assume-unchanged .settings/​org.eclipse.core.resources.prefs </​code>​ +
- +
-as long as the driverlib in CCS for Mac OS are not updated. +
- +
-{{ :​driverlib1.png |}} +
-{{ :​driverlib2.png |}} +
-  +
-====== Using CCS 6 on Octanis Dev-Box ====== +
- +
-  - Download and run the [[https://​github.com/​Octanis1/​Octanis1-dev-box|Octanis Dev-Box VM]] +
-  - Inside the VM, download CCS from [[https://​www.ti.com/​licreg/​docs/​swlicexportcontrol.tsp?​form_type=2&​prod_no=CCS6.1.0.00104_web_linux.tar.gz&​ref_url=http://​software-dl.ti.com/​ccs/​esd/​CCSv6/​CCS_6_1_0/​ +
-|here]]. TI-Account required. +
-  - Unpack the downloaded file and follow this TI guide: http://​processors.wiki.ti.com/​index.php/​Linux_Host_Support_CCSv6#​Ubuntu_13.10_32bit +
-  - Add PATH=/​opt/​ti/​ccsv6/​utils/​bin:​$PATH to the end of your .bashrc +
-  - Open CCS and start developing! +
-  - Currently only the following project settings are unlimited:​ +
-{{::​screen_shot_2015-03-30_at_19.45.06.png?​400|}} +
- +
- +
-( [[sublime-text-3-configfiles | Sublime Text 3 Config Files]] ) +
- +
- +
-==== Checking code size of CCS generated .out file ==== +
-<​code>​ +
->​C:​\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_8-2014q3\bin\arm-none-eabi-size.exe .\Octanis1-Mainboard-Firmware_MSP_EXP432P401RLP.out +
- +
-   ​text ​   data     ​bss ​    ​dec ​    hex filename +
-  75523    5296   ​13960 ​  ​94779 ​  1723b .\Octanis1-Mainboard-Firmware_MSP_EXP432P401RLP.out +
- +
-</​code>​ +
- +
-Where "​text"​ is occupied flash. +
- +
----- +
- +
-====== Known Errors ====== +
- +
-=== Target Debugging Fails === +
-{{::​14-08-2015-12-40-59-2666.png?​200|}} +
- +
-**When does this happen?**: Currently only fails with the current octanis firmware (75kB) after adding more mailboxes. +
- +
-**Solution**:​ Unknown. This error disappears when choosing "​JTAG"​ mode in the target config. It currently doesn'​t seem to work with SWD mode disabled. +
- +
-**Workaround**:​ Use a different launchpad! It seems to be an issue with the onboard debugger being either bricked or unreliable. +
- +
- +
- +
- +
- +
----- +
- +
- +
- +
-====== Deprecated Methods ====== +
-The following is an alternative to CCS. These methods are currently unsupported. +
- +
-===== Installing the MSP430 tools for Eclipse ===== +
-[[eclipse-tools|See this document]] +
- +
-===== Setting up a fresh Eclipse project ===== +
-  * Make sure MSP430->​Tool Manager has activated the msp430 toolchain (if not, select the directory where you installed it) +
-  * File->​New->​C Project. Select MSP430 Cross Target Application. Name the new project, click twice on next and select the correct mircocontroller (MSP430f5529). Click finish +
-  * Right-click on the project in the side bar, select Properties. +
-  * In C/C++ Build -> Settings -> Tool Settings -> Includes, add the path  msp-toolchain/​msp340/​Include and Octanis1-Eclipse/​Include +
-  * In C/C++ Build -> Settings -> Tool Settings -> Libraries, add the path msp-toolchain/​msp430/​lib +
-  * In C/C++ General -> Paths and Symbols -> Source Location, Link Folder Octanis1-Eclipse/​Source and any other folder outside the project folder containing source files +
-  * In MSP430, select the tilib driver. +
-  * Click Apply and OK +
-  * Build Project +
- +
- +
-===== Flashing the MSP430 with CodeComposerStudio from TI (win,linux) ===== +
- +
-  * Install ccs +
-  * Connect a launchpad via USB to your computer +
-  * Connect Octanis board via SBW to the launchpad +
-  * Open an example project in ccs (for instance Blink). Choose the one for MSP430F55xx. +
-  * Click on debug to flash the board +
-  * If you get an error saying "Error connecting to target: No MSP430 device was found on USB FET 1" a reboot of your operating system might resolve the issue. Otherwise check in Project->​Properties->​General if you have th switch the connection from USB1 to USBx. +
- +
- +
-===== Programming the MSP430 with Energia (all platforms) ===== +
-  * Download Energia +
-  * Merge contents of https://​github.com/​Octanis1/​Octanis1-Energia with Energia directory (Right click on Energia.app > "Show Package contents"​) +
-  * Connect a launchpad via USB to your computer +
-  * Connect Octanis board via SBW to the launchpad +
-  * The menu Tools->​Serial Port should be accesible and at least one device selectable. Select "the first"​. +
-  * In Tools->​Boards select Octanis 1 PCB v*** w/ MSP430f5529 (16MHz) +
-  * Open an example code (for instance Blink) and download it on the board. It is possible that you get an error message, that you have to update the programmer. Do this with Tools->​Update programmer. +
-  * If there is the error that no device is detected, try to change the serial port in the menu. +
- +
-===== Setting up TinyOS for MSP430 on Ubuntu 14.04 ===== +
- +
-[[https://​0x7d.com/​2013/​12/​running-tinyos-on-msp430-launchpads/​|Source]] +
- +
-First, uptdate your system: +
- +
-  $ sudo apt-get update +
-  $ sudo apt-get upgrade +
- +
-Then, if they aren't installed yet, get the following packages: +
- +
-  $ sudo apt-get install git stow subversion build-essential automake autoconf openjdk-6-jdk libusb-dev libreadline-dev +
-   +
-Finally, in any temporary directory (e.g. a subdirectory of your homefolder) +
- +
-<​code>​ +
-$ mkdir -p somewhere/​build +
-$ cd somewhere/​build +
-$ git clone https://​code.google.com/​p/​tinyos-msp430.scripts-tinyos/​ scripts-tinyos-msp430 +
-$ git clone https://​code.google.com/​p/​tinyos-msp430.scripts-msp430/​ scripts-msp430 +
-$ ./​scripts-tinyos-msp430/​toolchain.sh +
-$ ./​scripts-msp430/​toolchain.sh +
-$ ./​scripts-tinyos-msp430/​toolchain.sh cleanup +
-$ ./​scripts-msp430/​toolchain.sh cleanup +
-</​code>​ +
- +
-This will install TinyOS into /opt/tinyos and the msp430 toolchain into /​opt/​msp430. Before using any of these tools, it is required to set up the required environmental variables. Easiest, copy the following lines into your .bashrc (this file is located in your home directory):​ +
- +
-  # TinyOS and MSP430 environmental variables +
-  source /​opt/​tinyos/​scripts/​envsetup.subr +
-  source /​opt/​msp430/​scripts/​envsetup.subr +
-   +
-Run ''​source ~/​.bashrc''​ to make the changes effective. Then you're ready to go. +
- +
-===== Programming the MSP430 using a launchpad and connecting the Octanis board via SBW (not yet working) ===== +
- +
-Again, install some missing packages: +
- +
-  sudo apt-get install libboost-dev libtool libudev-dev libusb-1.0-0-dev +
- +
-Download [[https://​github.com/​signal11/​hidapi/​downloads|hidapi-0.7.0]] and extract it into any temporary folder (e.g. the same as used before to install TinyOS). +