aboutsummaryrefslogtreecommitdiff
path: root/laser-tag software/README
blob: 10c589502874f6ae2a21b69531f40e43375aa3f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Build instructions for Ubuntu:
0) apt-get install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi
1) export ARMGCC_DIR=/usr
   cd ../KSDK_1.2.0/lib/ksdk_platform_lib/armgcc/KL27Z4
   ./build_all.sh
   cd -
2) cd ../KSDK_1.2.0/usb/usb_core/device/build/armgcc/usbd_sdk_frdmkl27z_bm
   ./build_all.sh
   cd -
3) ./build_debug.sh -or- ./build_release.sh

Load instructions Kinetis Bootloader:
0) Download the Kinetis Bootloader[0]. (registration required)
1) Extract that huge zip and find the blhost executable for your OS in the bin directory.
2) Boot your badge into the ROM boot-loader by holding the direction pad UP while pressing reset.
3) It should show up as a USB-HID device.
4) Execute:
   blhost -u -- flash-erase-region 0 0x20000
   blhost -u -- write-memory 0 hello_world.bin
5) Load graphics if desired:
   blhost -u -- flash-erase-region 0x20000 0x5000
   blhost -u -- write-memory 0x20000 aha.im1
   blhost -u -- write-memory 0x21000 dc24.im1
   blhost -u -- write-memory 0x22000 my_name_is.im1
   blhost -u -- write-memory 0x23000 longhorn_lockpicking.im1
   blhost -u -- write-memory 0x24000 threatbutt.im1
6) Reset the badge or:
   blhost -u -- reset

Load instructions for openocd:
0) openocd
   in another terminal:
   telnet localhost 4444
   reset halt
1) in another terminal:
   gdb-multiarch -x gdb.init debug/hello_world.elf
   gdb) load
   gdb) monitor reset

Creating graphics:
0) Create a 232 x 128 black and white (not greyscale) image
1) Use gimp to convert it to "SUN Rasterfile image" with the extension .im1
2) Choose Standard Data Formatting, not RunLength Encoded
3) Check that the image file size is 3872 bytes

Load images with blhost:
   blhost -u -- flash-erase-region 0x20000 0x5000
   blhost -u -- write-memory 0x20000 image0.im1
   blhost -u -- write-memory 0x21000 image1.im1
   blhost -u -- write-memory 0x22000 image2.im1
   blhost -u -- write-memory 0x23000 image3.im1
   blhost -u -- write-memory 0x24000 image4.im1

Load images with dd:
0) Plug the badge in to your computer's USB port
1) Note the five USB drives that appear
2) dd (on Linux/BSD/OSX?) or rawrite (on Winblows) images to those drives
   Example:
   dd if=image0.im1 of=/dev/sdb
   dd if=image1.im1 of=/dev/sdc
   dd if=image2.im1 of=/dev/sdd
   dd if=image3.im1 of=/dev/sde
   dd if=image4.im1 of=/dev/sdf

[0] http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m/kinetis-symbols-footprints-and-models/kinetis-bootloader:KBOOT