Recent Changes - Search:

edit SideBar


  • hail "Hail is an embedded IoT module for running Tock. It is programmable over USB, uses BLE for wireless, includes temperature, humidity, and light sensors, and has an onboard accelerometer. Further, it conforms to the Particle Photon form-factor." - Unknown availability. does not list it. Brendan has a few. See hail.pptx (account needed) for details.

Hail Board

The Hail Board uses a ATSAM4LC8BA, which has 512K Flash and 64K SRAM.

To get started on the Mac, see

Be sure to use the arm-none-eabi-gcc from Brew. If you try to use Macports, you will get

  note: /opt/local/lib/gcc/arm-none-eabi/5.1.0/../../../../arm-none-eabi/bin/ld: cannot find crt0.o: No such file or directory

Be sure to update your path:

export PATH=/usr/local/Cellar/arm-none-eabi-gcc/5-2016-q3-update/bin:${PATH}

The Hail uses a USB MicroB connector and typically comes provisioned with the blink userland example running.

Hail Examples

The user programs are in tock/userland/examples

Mac OS X: To compile and upload an example, plug in the board and then run ls -ltr /dev/tty* and look for *usbserial:

bash-3.2$ ls -ltr /dev/tty* | tail
crw-rw-rw-  1 root  wheel    4,   4 Jan  7 10:03 /dev/ttyp4
crw-rw-rw-  1 root  wheel    4,   3 Jan  7 10:03 /dev/ttyp3
crw-rw-rw-  1 root  wheel    4,   2 Jan  7 10:03 /dev/ttyp2
crw-rw-rw-  1 root  wheel    4,   1 Jan  7 10:03 /dev/ttyp1
crw-rw-rw-  1 root  wheel    4,   0 Jan  7 10:03 /dev/ttyp0
crw-rw-rw-  1 root  wheel   18,   0 Jan  7 10:03 /dev/tty.Bluetooth-Incoming-Port
crw-rw-rw-  1 root  wheel   18,   2 Jan  7 12:35 /dev/tty.usbserial-00001014
crw--w----  1 cxh   tty     16,   1 Jan  7 12:36 /dev/ttys001
crw-rw-rw-  1 root  wheel    2,   0 Jan  7 12:37 /dev/tty
crw--w----  1 cxh   tty     16,   0 Jan  7 12:37 /dev/ttys000

/dev/tty.usbserial-00001014 is the port of the Hail board.

If the port is not visible, reboot or see Mac OS Missing TTY Port

To compile TockOS and upload, run:

cd tockos/boards/hail
make PORT=/dev/tty.usbserial-00001014 TOCK_BOARD=hail program

To install the blink program:

cd ../../userland/examples/blink
make PORT=/dev/tty.usbserial-00001014 TOCK_BOARD=hail program

Hail Read from Stdout

tock/userland/examples/c_hello prints to stdout. To read from stdout, use tockloader --port /dev/ttyxxx listen:

bash-3.2$ pwd
bash-3.2$ cat main.c
/* vim: set sw=2 expandtab tw=80: */

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <console.h>

char hello[] = "Hello World!\r\n";

void nop() {}

int main() {
  putnstr_async(hello, sizeof(hello), nop, NULL);
  return 0;
bash-3.2$ make PORT=/dev/tty.usbserial-00001014 TOCK_BOARD=hail program
 DEP        main.c
  CC        main.c
  CC        ../../libtock/FXOS8700CQ.c
  CC        ../../libtock/tsl2561.c
  AR        ../../libtock/build/cortex-m4/libtock.a
  LD        build/cortex-m4/app.elf
 BIN        build/cortex-m4/app.bin
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `/Users/cxh/src/hail/tock/userland/tools/elf2tbf/target/debug/elf2tbf -n c_hello -o build/cortex-m4/app.bin build/cortex-m4/app.elf`
tockloader --port /dev/tty.usbserial-00001014 flash --address 0x30000 build/cortex-m4/app.bin
Wrote 1024 bytes in 0.128 seconds
CRC check passed. Binaries successfully loaded.
bash-3.2$ tockloader --port /dev/tty.usbserial-00001014 listen
Hello World!
&#9216;  C-c C-cbash-3.2$

However, note that running two putnstr_async() calls back to back probably will not produce output for the second call.

Instead, use void putnstr(const char* str, size_t len);

Hail Duktape Build

Hail Problems


The Hail board has two JTAG ports, one on the top for the ARM chip, one on the bottom for the NRF BLE Chip (Need to verify this)

See Also

Edit - History - Print - Recent Changes - Search
Page last modified on February 23, 2017, at 06:54 PM