The code base currently supports two embeddedd platforms - the chipKIT (based on the Microchip PIC32) and the Blueboard (based on the NXP LPC1768/69). Before you can compile, you will need to define your CAN messages.
The build process works with Linux (tested in Arch Linux and Ubuntu), OS X and Cygwin in Windows.
Note
When running make to compile, try adding the -j4 flag to build jobs in parallel - the speedup can be quite dramatic.
Once the dependencies are installed, attach the chipKIT to your computer with a mini-USB cable, cd into the src subdirectory, build and upload to the device.
$ git submodule init && git submodule update
$ make clean
$ make
$ make flash
If the flash command can’t find your chipKIT, you may need to set the SERIAL_PORT variable if the serial emulator doesn’t show up as /dev/ttyUSB* in Linux, /dev/tty.usbserial* in Mac OS X or com3 in Windows. For example, if the chipKIT shows up as /dev/ttyUSB4:
$ SERIAL_PORT=/dev/ttyUSB4 make flash
and if in Windows it appeared as COM4:
$ SERIAL_PORT=com4 make flash
If the compilation didn’t work:
If you get a lot of errors about undefined refernece to getSignals()' and other functions, you need to make sure you defined your CAN messages - read through CAN Message Definition before trying to compile.
It is possible to use an IDE like Eclipse to edit and compile the project.
If you didn’t set up the environment variables from the Installation section (e.g. MPIDE_HOME), you can also do that from within Eclipse in C/C++ project settings.
There will still be some errors in the Eclipse problem detection, e.g. it doesn’t seem to pick up on the GCC __builtin_* functions, and some of the chipKIT libraries are finicky. This won’t have an effect on the actual build process, just the error reporting.
Support for the NXP LPC17xx, an ARM Cortex M3 microcontroller, is experimental at the moment and the documentation is incomplete. We are building successfully on the NGX Blueboard 1768-H using the Olimex ARM-OCD-USB JTAG programmer.
Once the dependencies are installed, attach a JTAG adapter to your computer and the CAN translator, then compile and flash:
$ make clean
$ PLATFORM=BLUEBOARD make -j4
$ PLATFORM=BLUEBOARD make flash
The config files in this repository assume your JTAG adapter is the Olimex ARM-USB-OCD unit. If you have a different unit, change the first line in conf/flash.cfg to the correct value.