A lightweight software library and selftest application for the arm-bmw development board.
git clone https://github.com/vsergeev/arm-bmw-sw.git
git clone http://git.theanine.io/arm-bmw-sw.git
The self-test application provides a basic CLI over the UART with hardware unit tests and utility programs. The UART is configured for 115200 8N1, and the CLI may be accessed with your favorite serial port program.
The hardware unit tests include UART, SPI, I2C, SPI Flash, I/O Expander, and UI tests. These tests combine loopbacks and interactive verification to verify the correct operation of the hardware. See the tests in the apps/selftest/tests folder for more information.
A passing test log can be found in arm-bmw-selftest.log.
lpc1114.dldLPC1114 linker script
openocd/OpenOCD flash and debug scripts
cmsis/CMSIS header files
lpc11xx/LPC11xx header files
startup.cInterrupt vector table and reset handler
tick.hSysTick handler and
io/peripheral I/O drivers
uart.hPolling UART driver
spi.hPolling SPI driver
adc.hPolling ADC driver
i2c.hInterrupt-driven I2C driver
queue.hQueue data structure for I2C driver
i2c_reg.hI2C register read/write wrappers for I2C driver
mcp23008.hI/O Expander driver
sf.hSPI Flash driver
debug.hDebug printf function
test.hAssertion framework/macros for testing
bmw_ui.hWrapper for BMW's User Interface (LEDs and buttons)
pybmw/Python µRPC client
cli_programs.cSelf-test CLI handlers
rpc_handlers.cSelf-test RPC handlers
test_spi_flash.cSPI Flash Memory test
test_mcp23008.cI/O Expander test
test_bmw_ui.cBMW User Interface test
Building, Flashing, Debugging
The Makefile builds the sources in
src/ into a static library, and with it, an application in
app/ into a program file. The application to build from
app/ is specified with the
APP environment variable. If
APP is not specified, the application defaults to
The GNU arm-none-eabi cross-compiler prefix is specified with the
CROSS environment variable. If
CROSS is not defined, the compiler prefix defaults to
For example, to build the
selftest application, run:
make APP=selftest all
This will produce the program files
arm-bmw-selftest.elf,hex,bin and the memory map
obj/arm-bmw-selftest.map, among other build products.
The available Makefile targets are:
make APP=<app> allBuild the static library, and with it, the application
make APP=<app> cleanClean the build products and build directory
make APP=<app> statDump program symbols and section sizes
make APP=<app> flashFlash the program file over JTAG with OpenOCD
make APP=<app> flashispFlash the program file over UART with lpc21isp
make APP=<app> debugFlash the program file over JTAG with OpenOCD and halt the target for debugging
make APP=<app> gdbLaunch gdb and connect to OpenOCD's gdbserver for debugging
Flashing over JTAG with OpenOCD
make APP=selftest flash
Flashing with OpenOCD requires an SWD-capable JTAG dongle, like the ST-LINK/V2.
Flashing over UART with lpc21isp
make APP=selftest flashisp
Flashing with lpc21isp requires a serial port cable connected to the arm-bmw UART header. Be sure to reset the arm-bmw board with the bootloader header jumpered before flashing, to start the microcontroller into its on-chip ROM bootloader.
LPC21ISP_SERIAL_PATH variable may need to be updated with the correct serial port device path in the Makefile.
Debugging with GDB
debug target uses OpenOCD to flash the program, halt the target, and launch OpenOCD's gdbserver. Debugging the arm-bmw with OpenOCD requires an SWD-capable JTAG dongle, like the ST-LINK/V2.
make APP=selftest debug
While OpenOCD is running from the command above, launch gdb with:
make APP=selftest gdb
GDB will connect to OpenOCD's gdbserver and allow you to interactively debug the target.
More comprehensive library documentation is in progress. Please examine the selftest code in apps/selftest and the library header files for now.
arm-bmw-sw is MIT licensed. See the included