Project

General

Profile

Firmware » History » Version 7

horiz0n, 02/19/2016 10:51 PM

1 7 horiz0n
{{>toc}}
2 1 laforge
3 7 horiz0n
h1. [[OsmoSDR]] Firmware
4 1 laforge
5 7 horiz0n
6
The [[OsmoSDR]] firmware is written in C language.  It uses a modified version of the Atmel-provided sam3u drivers (at91lib).
7
8 1 laforge
There are multiple firmware images available, providing different interfaces towards the host PC.
9
10
11 7 horiz0n
h2. Firmware Variants
12
13
14 1 laforge
There are multiple firmware images available, providing different interfaces towards the host PC.
15
16
17 7 horiz0n
h3. standard (usb-audio) firmware
18
19
20 1 laforge
The standard firmware image exports a composite USB device with two interfaces:
21 7 horiz0n
* A USB standard audio class device (for actual received baseband samples)
22
* A USB CDC-ACM serial device (for hardware control like tuning)
23 1 laforge
24
The audio class device offers (at least) two sample rates:
25 7 horiz0n
* a high sample rate (1/2/4 MHz) for USB Audio drivers like the ALSA driver included in mainline Linux
26
* a low sample rate of 96 kHz (possibly 128 kHz) to work with the poor USB Audio driver of MS Windows OSs
27 1 laforge
28
29 7 horiz0n
h2. Firmware flashing
30
31
32 1 laforge
There are two methods of flashing the firmware:
33
34
35 7 horiz0n
h3. DFU firmware flashing
36
37
38 1 laforge
This is currently being worked on.  FIXME.
39
40
41 7 horiz0n
h3. SAM-BA / rum-ba firmware flashing
42
43
44 1 laforge
The sam3u contains a ROM based recovery boot loader called "SAM-BA".  To activate this loader,
45
you have to
46 7 horiz0n
* power down the device
47
* close the ERASE jumper
48
* power up the device (1 second is sufficient)
49
* power down the device
50
* remove the ERASE jumper
51
* power up the device again
52 1 laforge
53
You will now the SAM-BA enumerate on USB using the following parameters:
54 7 horiz0n
* Vendor ID 0x03eb
55
* Product ID 0x6124
56
* String: "Atmel Corp. at91sam SAMBA bootloader"
57 1 laforge
58
The SAM-BA loader exports a CDC-ACM (virtual serial port) interface.
59
60 7 horiz0n
<pre>
61
<pre>
62 2 laforge
$ ./rumba /dev/ttyACM0 flashmcu loader.bin
63 7 horiz0n
</pre>
64 2 laforge
65 3 laforge
66 7 horiz0n
h2. Firmware building
67
68
69
* You first need to build and/or obtain a Cortex-M3 [[Toolchain]].
70
* Next, in addition to osmo-sdr.git you also need a clone of at91lib.git from git://git.gnumonks.org/at91lib.git which needs to be
71 4 horiz0n
   on the same level as osmo-sdr.git, i.e. one common parent directory between at91lib and osmo-sdr
72
73 5 horiz0n
74 7 horiz0n
h2. Flashing the Firmware
75
76
77 4 horiz0n
Flash the application partition
78 7 horiz0n
<pre>
79 4 horiz0n
dfu-util -d 16c0:0763 -i0 -a0 -D firmware/osmosdr-project/bin/osmo-sdr-test-osmo-sdr-at91sam3u4-dfu.bin
80 7 horiz0n
</pre>
81 6 horiz0n
82 4 horiz0n
Convert FPGA image:
83 7 horiz0n
<pre>
84 4 horiz0n
utils/vmelinearize$ ./vmelin ../../fpga/hw-v2/deploy/usbrx_algo.vme ../../fpga/hw-v2/deploy/usbrx_data.vme > /tmp/fpga.out
85 7 horiz0n
</pre>
86 1 laforge
87
Flash the FPGA partition
88 7 horiz0n
<pre>
89 1 laforge
dfu-util -d 16c0:0763 -i0 -a3 -D /tmp/fpga.out
90 7 horiz0n
</pre>
91 1 laforge
ignore "Error during download"
Add picture from clipboard (Maximum size: 48.8 MB)