Skip to content

Firmware for the Cambridge Physical Computation Laboratory's Warp Embedded Multi-Sensor Platform.

License

Notifications You must be signed in to change notification settings

efosong/Warp-firmware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warp

Baseline firmware for the Warp hardware platform.

Prerequisites

You need an arm cross-compiler such as arm-none-eabi-gcc installed as well as a working cmake (installed, e.g., apt-get on Linux or via MacPorts on macOS). You will also need an installed copy of the SEGGER JLink commander, JlinkExe, which is available for Linux, macOS, and Windows (here are direct links for downloading it for macOS, and Linux tgz 64-bit).

Building the Warp firmware

First, make sure the environment variable ARMGCC_DIR is set correctly (you can check whether this is set correctly, e.g., via echo $ARMGCC_DIR. If this is unfamiliar, see here or here). If your arm-none-eabi-gcc is in /usr/local/bin/arm-none-eabi-gcc, then you want to set ARMGCC_DIR to /usr/local. If your shell is tcsh:

setenv ARMGCC_DIR <full path to the directory containing bin/arm-none-eabi-gcc>

Alternatively, if your shell is bash

export ARMGCC_DIR=<full path to the directory containing bin/arm-none-eabi-gcc>

(You can check what your shell is, e.g., via echo $SHELL.) Second, edit the jlink command file, tools/scripts/jlink.commands to include the correct path.

Third, you should be able to build the Warp firmware by

cd build/ksdk1.1/
./build.sh

This copies the files from Warp/src/boot/ksdk1.1.0/ into the KSDK tree, builds, and converts the binary to SREC. See Warp/src/boot/ksdk1.1.0/README.md for more.

Fourth, you will need two terminal windows. You will need to run the following two commands within one/two seconds of each other. In one shell window, run the firmware downloader. On MacOS, this will be:

/Applications/SEGGER/JLink/JLinkExe -device MKL03Z32XXX4 -if SWD -speed 4000 -CommanderScript ../../tools/scripts/jlink.commands

In the second shell window, launch the JLink RTT client. On MacOS, this will be:

/Applications/SEGGER/JLink/JLinkRTTClient

Editing the firmware

The firmware is currently all in src/boot/ksdk1.1.0/, in particular, see src/boot/ksdk1.1.0/warp-kl03-ksdk1.1-boot.c.

The firmware builds on the Kinetis SDK. You can find more documentation on the Kinetis SDK in the document doc/Kinetis SDK v.1.1 API Reference Manual.pdf.

The firmware is designed for the Warp hardware platform, but will also run on the Freeacale FRDM KL03 development board. In that case, the only driver which is relevant is the one for the MMA8451Q. For more details about the structure of the firmware, see /src/boot/ksdk1.1.0/README.md.

Interacting with the boot menu.

When the firmware boots, you will be dropped into a menu:

[ *				W	a	r	p			* ]
[ *			      Cambridge / Physcomplab / PSM			* ]

	Supply=0mV,	Default Target Read Register=0x00
	I2C=1kb/s,	SPI=1kb/s,	UART=1kb/s,	I2C Pull-Up=1
Select:
- 'a': set default sensor.
- 'b': set I2C baud rate.
- 'c': set SPI baud rate.
- 'd': set UART baud rate.
- 'e': set default register address.
- 'f': write byte to sensor.
- 'g': set default SSSUPPLY.
- 'h': powerdown command to all sensors.
- 'i': set pull-up enable flag.
- 'j': repeat read reg 0x00 on device0.
- 'k': sleep for 30 seconds.
- 'l': send repeated byte on I2C.
- 'm': send repeated byte on SPI.
- 'n': enable SSSUPPLY.
- 'o': disable SSSUPPLY.
- 'x': disable SWD and spin for 10 secs.
Enter selection> 

You can probe around the menus to figure out what to do. In brief, you will likely want:

  1. Menu item a to set target sensor.

  2. Menu item g to set sensor supply voltage on Warp board.

  3. Menu item e to set the default register address to read from.

  4. Menu item j to do a series of repeated reads from the specified default register (optionally auto-incrementing, etc.).

NOTE: The menu interface eats your characters as you type them, and you should not hit RETURN after typing in text. In many cases, the menu expects you to type a fixed number of characters (e.g., 0000 or 0009 for zero and nine).

Example:

Enter selection> j

    Auto-increment from base address 0x01? ['0' | '1']> 0
    Chunk reads per address (e.g., '1')> 1
    Chatty? ['0' | '1']> 1
    Inter-operation spin delay in milliseconds (e.g., '0000')> 0000
    Repetitions per address (e.g., '0000')> 0000
    Maximum voltage for adaptive supply (e.g., '0000')> 2500
    Reference byte for comparisons (e.g., '3e')> 00

To update your fork

From your local clone:

git remote add upstream https://github.com/physical-computation/Warp-firmware.git
git fetch upstream
git pull upstream master

If you use Warp in your research, please cite it as:

Phillip Stanley-Marbell and Martin Rinard. “A Hardware Platform for Efficient Multi-Modal Sensing with Adaptive Approximation”. ArXiv e-prints (2018). arXiv:1804.09241.

BibTeX:

@ARTICLE{1804.09241,
  author = {Stanley-Marbell, Phillip and Rinard, Martin},
  title = {A Hardware Platform for Efficient Multi-Modal Sensing with Adaptive Approximation},
  journal = {ArXiv e-prints},
  archivePrefix = {arXiv},
  eprint = {1804.09241},
  year = 2018,
}

Acknowledgements

This research is supported by an Alan Turing Institute award TU/B/000096 under EPSRC grant EP/N510129/1, by Royal Society grant RG170136, and by EPSRC grants EP/P001246/1 and EP/R022534/1.

About

Firmware for the Cambridge Physical Computation Laboratory's Warp Embedded Multi-Sensor Platform.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 95.0%
  • C++ 3.3%
  • Makefile 1.0%
  • Assembly 0.3%
  • CMake 0.3%
  • Batchfile 0.1%