Project

General

Profile

Firmware » History » Version 5

horiz0n, 02/19/2016 10:50 PM

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