SIMtrace Firmware » History » Version 4
Anonymous, 02/19/2016 10:48 PM
1 | 1 | laforge | = SIMtrace Firmware = |
---|---|---|---|
2 | |||
3 | 4 | laforge | The Firmware for the AT91SAM7S device was written by reusing a lot of the code for the [http://www.openpcd.org/ OpenPCD] |
4 | RFID reader. |
||
5 | 1 | laforge | |
6 | 4 | laforge | There is a {{{simtrace}}} Makefile target in the git://git.gnumonks.org/openpcd.git repository containing the latest firmware code. |
7 | |||
8 | Eventually, the OS part of OpenPCD/OpenPICC/SIMtrace will be separated. At that point, the firmware source can become |
||
9 | part of simtrace.git |
||
10 | |||
11 | == Building the firmware == |
||
12 | |||
13 | Precondition: You need to set your PATH in a way that contains an arm-elf [wiki:toolchain], i.e. the same way that you build [wiki:GettingStarted OsmocomBB]. |
||
14 | |||
15 | {{{ |
||
16 | git clone git://git.gnumonks.org/openpcd.git |
||
17 | cd openpcd/firmware |
||
18 | make -f Makefile.dfu BOARD=SIMTRACE |
||
19 | make BOARD=SIMTRACE DEBUG=1 TARGET=main_simtrace |
||
20 | cat dfu.bin main_simtrace.bin > main_simtrace.samba |
||
21 | cd ../.. |
||
22 | }}} |
||
23 | |||
24 | === Firmware parts === |
||
25 | |||
26 | The firmware build process creates two images: |
||
27 | * dfu.bin -- the sam7dfu 2nd level bootloader. It implements the USB DFU (Device Firmware Upgrade) profile. |
||
28 | * main_simtrace.bin -- the actual simtrace program. To be loaded via DFU, using [http://dfu-util.gnumonks.org/ dfu-util]. |
||
29 | * main_simtrace.samba -- [http://www.openpcd.org/Sam7dfu sam7dfu] + simtrace image. to be loaded via SAM-BA, using sam7utils (see below). |
||
30 | |||
31 | |||
32 | ==== sam7utils ==== |
||
33 | |||
34 | sam7utils will be used to flash the '''main_simtrace.samba''' image over SAM-BA. |
||
35 | {{{ |
||
36 | sudo aptitude install libreadline-dev |
||
37 | wget http://www.openpcd.org/dl/sam7utils-0.2.1-bm.tar.bz2 |
||
38 | tar xf sam7utils-*.tar.bz2 |
||
39 | cd sam7utils |
||
40 | ./configure --prefix=/usr/local |
||
41 | make |
||
42 | }}} |
||
43 | |||
44 | to flash the samba image using serial : |
||
45 | {{{ |
||
46 | sudo ./sam7 -l /dev/ttyUSB0 --exec set_clock --exec unlock_regions --exec "flash ../openpcd/firmware/main_simtrace.samba" |
||
47 | }}} |
||
48 | to flash the samba image using libusb : |
||
49 | {{{ |
||
50 | sudo ./sam7 --exec set_clock --exec unlock_regions --exec "flash ../openpcd/firmware/main_simtrace.samba" |
||
51 | }}} |
||
52 | |||
53 | if you want to use sam7 multiple times, remove the loaded module after each run: |
||
54 | {{{ |
||
55 | sudo rmmod sam_ba |
||
56 | }}} |
||
57 | |||
58 | ===== sam7utils for x86 ===== |
||
59 | |||
60 | On x86, sam7utils will be compiled to communicate with the board using POSIX. |
||
61 | |||
62 | The board should be attached to a node. On ubuntu 10.10, the usb device 03eb:6124 is mapped on /dev/ttyACM0 using the cdc_cam module. If not mapped, use usbserial : |
||
63 | {{{ |
||
64 | sudo rmmod usbserial |
||
65 | sudo modprobe usbserial vendor=0x03EB product=0x6124 |
||
66 | }}} |
||
67 | |||
68 | Now replug board. It should map to /dev/ttyUSBx (use dmesg to know which). |
||
69 | |||
70 | ===== sam7utils for amd64 ===== |
||
71 | |||
72 | On amd64, sam7utils will be compiled to communicate with the board using libusb. |
||
73 | |||
74 | On ubuntu 10.10 & 11.04, the usb device 03eb:6124 is mapped on /dev/ttyACMx using the cdc_cam module. |
||
75 | Remove it while the board is plugged, so sam7utils is able to communicate with it (using libusb for 10.10 and serial for 11.04). |
||
76 | {{{ |
||
77 | sudo rmmod cdc_acm |
||
78 | }}} |
||
79 | |||
80 | |||
81 | 1 | laforge | == DFU Image == |
82 | |||
83 | DFU images only contain the actual SIMtrace application firmware, but not the bootloader (sam7dfu). |
||
84 | |||
85 | They can be installed using '''dfu-util'''. Their installation does not require any jumper-setting or |
||
86 | cable plugging/unplugging. |
||
87 | |||
88 | * Firmware v0.2: |
||
89 | == SAM-BA Image == |
||
90 | |||
91 | 2 | laforge | SAM-BA images contain a full NOR flash image. They can be used in case the sam7dfu bootloader was corrupted, |
92 | and can be installed either using the '''sam7''' program released by Atmel, or via JTAG based flashing. |
||
93 | |||
94 | Installing firmware using SAM-BA is a bit cumbersome and requires strict adherence to a sequence of USB cable plugging/unplugging and jumper setting, waiting, jumper removal, etc. |
||
95 | 3 | laforge | |
96 | |||
97 | == Bugs == |
||
98 | |||
99 | Currently there is a bug in the firmware that makes the device fail to enumerate on OSX. We provide an alternative hacked firmware until we have resolved the issue properly. |