Ford Prototype Vehicle Interface ================================ To build for the Ford prototype, compile with the flag ``PLATFORM=FORDBOARD``. Flashing a Pre-compiled Firmware -------------------------------- Pre-compiled binaries (built with the ``BOOTLOADER`` flag enabled, see all `compiler flags `_) are compatible with the `OpenLPC USB bootloader `_ - follow the instructions for `Flashing User Code `_ to update the vehicle interface. Bootloader ---------- The `OpenLPC USB bootloader `_ is tested and working, and enables the LPC17xx to appear as a USB drive. See the documentation in that repository for instructions on how to flash the bootloader (a JTAG programmer is required). Compiling --------- USB Bootloader """""""""""""" If you are running a :doc:`supported bootloader `, you don't need any special programming hardware. Compile the firmware to run under the bootloader: .. code-block:: sh $ make clean $ PLATFORM=BLUEBOARD BOOTLOADER=1 make -j4 The compiled firmware will be located at ``build/lpc17xx/cantranslator-lpc17xx.bin``. See the :doc:`bootloaders `_ page for instructions on how to load the firmware. Bare Metal """""""""" Once the :doc:`dependencies ` are installed, attach a JTAG adapter to your computer and the CAN translator, then compile and flash: .. code-block:: sh $ 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, modify the ``src/lpc17xx/lpc17xx.mk`` Makefile to load your programmer's OpenOCD configuration. UART ---- On the LPC17xx, ``UART1`` is used for OpenXC output at the 230000 baud rate. Like on the chipKIT, hardware flow control (RTS/CTS) is enabled, so CTS must be pulled low by the receiving device before data will be sent. - Pin 2.0 - ``UART1 TX``, connect this to the RX line of the receiver. - Pin 2.1 - ``UART1 RX``, connect this to the TX line of the receiver. - Pin 2.2 - ``UART1 CTS``, connect this to the RTS line of the receiver. - Pin 2.7 - ``UART1 RTS``, connect this to the CTS line of the receiver. Debug Logging ------------- Logging will be on UART0, which is exposed on the bottom of the board at J3, a 5-pin ISP connector. LED Lights ---------- The Ford prototype has 2 RGB LEDs. **LED A** - CAN activity detected - Blue - No CAN activity on either bus - Off **LED B** - USB connected, Bluetooth not connected - Green - Bluetooth connected, USB in either state - Blue - Neither USB or Bluetooth connected - Off