OpenMRN on Ubuntu 16.04LTS, 64-bit for Tiva TM4C123GXL

So you just installed Ubuntu 16.04 LTS, 64-bit desktop on a computer and received your Tiva TM4C123GXL ($12.99) in the mail. When you plug your Tiva in, you’ll get a device at /dev/ttyACM0 (and lsusb might show: Bus 00x Device 00x: ID 1cbe:00fd Luminary Micro Inc. In-Circuit Debug Interface)

Back to the OS:

sudo apt-get update
sudo apt-get upgrade

(I also like to use emacs and ssh, so:

sudo apt-get install emacs openssh-server)

(usually a good idea to restart, press Ctrl-Alt-F1 and login to notice the “*** System restart required ***”, or ssh in and get the same notice. )

(and you could also install JMRI and Java, but I’ll do that in a bit, Tiva first)

sudo apt-get install git

(now we create a folder in place we like, like /home/me/prj/LCC)

mkdir -p ~/prj/LCC

(and go there)

cd ~/prj/LCC

(then clone the repository)

git clone https://github.com/bakerstu/openmrn

(to see what I got, I change over to the openmrn folder and typed make, just making sure git got something!)

cd ~/prj/LCC/openmrn
make

(and things will compile using g++ ending with some error like:

******************************************************************
*
* Unable to build for freertos.armv7m, missing dependencies: HAVE_MBED FREERTOSPATH TOOLPATH
*
******************************************************************
)

~/prj/LCC/openmrn/bin$ sudo ./install_tools.sh

(This will download and might install tools like:

gcc-arm-none-eabi-4_8-2014q1

gmock-1.7.0

FreeRTOSV8.2.1

lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769,

STM32Cube_FW_F0_V1.2.0

STM32Cube_FW_F3_V1.2.0

SW-TM4C-2.1.1.71   <– oops, wait, you need to log into the Ti website and agree to the expert restrictions to get this file! See the instructions following this.

etc., etc.)

cd /opt/gmock/default
 sudo ./configure
 sudo make

(Ti needs to make sure you won’t use the software for bad things, so head over to the Tiva software page at http://www.ti.com/tool/sw-tm4c and agree and download the “Full Release” TivaWare for TM4C Series. Today it was version SW-TM4C-2.1.2.111.exe! Once you have the 170MB file in your Downloads folder, do:  )

cd ~/Downloads/
export INSTALL_DIR="/opt"
sudo mkdir -p  $INSTALL_DIR/ti/TivaWaresudo unzip -d 
  $INSTALL_DIR/ti/TivaWare/SW-TM4C-2.1.2.111 
  SW-TM4C-2.1.2.111.exe
cd $INSTALL_DIR/ti/TivaWare
sudo rm -f default
sudo ln -s SW-TM4C-2.1.2.111 default

(and while we are installing things related to hardware, get at least the version 0.9.0 of openocd, some notes here🙂

me@M:~$ sudo apt-get install openocd

me@M:~$ openocd --version
Open On-Chip Debugger 0.9.0 (2015-09-02-10:42)
Licensed under GNU GPL v2

(now, clean up a bit)

sudo apt-get autoremove

(then install some more, might not need everything here, but I am trying from a year ago…)

sudo apt-get install autoconf texinfo gksu 
sudo apt-get install python-software-properties
sudo apt-get install lib32ncurses5 lib32z1 
sudo apt-get install libncurses5-dev
sudo apt-get install libncurses5:i386
sudo apt-get install libgmp3-dev libmpfr-dev zlib1g-dev libtool libmpc-dev
sudo apt-get install build-essential flex bison 
sudo apt-get install python-yaml
sudo apt-get install libftdi-dev libftdi1 libusb-dev

(and set the path (don’t use a ‘~’, put the real folder in there))

export OPENMRNPATH=”/home/you/prj/LCC/openmrn” (the following compiles and runs, but it is a local app:)

~/prj/LCC/openmrn/applications/hub/targets/linux.x86$ 
  make

~/prj/LCC/openmrn/applications/hub/targets/linux.x86$ 
  ./hub
Listening on port 12021, fd 3

( With the Tivaware installed from Ti manually, you would see the following at end of a make in the ~/prj/LCC/openmrn/applications/blink_raw/targets/freertos.armv7m.ti-launchpad-lm4f120xl folder:)

/opt/armgcc/default/bin/arm-none-eabi-size blink_raw.elf
 text data bss dec hex filename
 39248 240 2084 41572 a264 blink_raw.elf
 /opt/armgcc/default/bin/arm-none-eabi-objdump -C -d -h blink_raw.elf > blink_raw.lst
 me@M:~/prj/LCC/openmrn/applications/blink_raw/targets/
  freertos.armv7m.ti-launchpad-lm4f120xl$ ls -l
 total 2184
 -rwxrwxr-x 1 me me 894020 Jul 22 07:46 blink_raw.elf

(similar success in the Clinic application folder:)

/opt/armgcc/default/bin/arm-none-eabi-size 
  clinic_app.elf
 text data bss dec hex filename
 39552 240 2132 41924 a3c4 clinic_app.elf
/opt/armgcc/default/bin/arm-none-eabi-objdump -C -d 
  -h clinic_app.elf > clinic_app.lst

(and now you should also be able to “flash” it using openocd:)

me@M:~/prj/LCC/openmrn/applications/blink_raw/targets/
  freertos.armv7m.ti-launchpad-lm4f120xl/sudo 
  make -j flash

(if you get an error like this, make sure the ‘default’ link points to something valid, like in “/opt/ti/TivaWare/” default -> SW-TM4C-2.1.2.111:)


************************************************************** 
* Unable to build for freertos.armv7m, missing 
dependencies: TIVAWAREPATH *
**************************************************************

(or you set the TIVAWAREPATH manually (don’t):)

 /freertos.armv7m.ek-tm4c123gxl/HwInit.cxx:37:26: fatal error: inc/hw_types.h: No such file or directory  #include "inc/hw_types.h"  ^ compilation terminated. /home/gert/prj/LCC/openmrn/etc/prog.mk:225: recipe for target 'HwInit.o' failed make: *** [HwInit.o] Error 1

(if you get an error like this, take the ‘~’ from the OPENMRNPATH:)

~/prj/LCC/openmrn/applications/blink_raw/main.cxx:38:19: fatal error: os/os.h: No such file or directory  #include "os/os.h"  ^ compilation terminated.

Now for some Serial port interaction:

sudo apt-get install minicom wvdial
Advertisements

~ by nambabwe on 2016/07/22.

 
%d bloggers like this: