Firmware » History » Revision 6
Revision 5 (horiz0n, 02/19/2016 10:50 PM) → Revision 6/8 (horiz0n, 02/19/2016 10:50 PM)
[[PageOutline]]
= OsmoSDR Firmware =
The OsmoSDR firmware is written in C language. It uses a modified version of the Atmel-provided sam3u drivers (at91lib).
There are multiple firmware images available, providing different interfaces towards the host PC.
== Firmware Variants ==
There are multiple firmware images available, providing different interfaces towards the host PC.
=== standard (usb-audio) firmware ===
The standard firmware image exports a composite USB device with two interfaces:
* A USB standard audio class device (for actual received baseband samples)
* A USB CDC-ACM serial device (for hardware control like tuning)
The audio class device offers (at least) two sample rates:
* a high sample rate (1/2/4 MHz) for USB Audio drivers like the ALSA driver included in mainline Linux
* a low sample rate of 96 kHz (possibly 128 kHz) to work with the poor USB Audio driver of MS Windows OSs
== Firmware flashing ==
There are two methods of flashing the firmware:
=== DFU firmware flashing ===
This is currently being worked on. FIXME.
=== SAM-BA / rum-ba firmware flashing ===
The sam3u contains a ROM based recovery boot loader called "SAM-BA". To activate this loader,
you have to
* power down the device
* close the ERASE jumper
* power up the device (1 second is sufficient)
* power down the device
* remove the ERASE jumper
* power up the device again
You will now the SAM-BA enumerate on USB using the following parameters:
* Vendor ID 0x03eb
* Product ID 0x6124
* String: "Atmel Corp. at91sam SAMBA bootloader"
The SAM-BA loader exports a CDC-ACM (virtual serial port) interface.
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:
{{{
$ ./rumba /dev/ttyACM0 flashmcu loader.bin
}}}
== Firmware building ==
* You first need to build and/or obtain a Cortex-M3 [wiki:Toolchain].
* 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
on the same level as osmo-sdr.git, i.e. one common parent directory between at91lib and osmo-sdr
== Flashing the Firmware ==
Flash the application partition
{{{
dfu-util -d 16c0:0763 -i0 -a0 -D firmware/osmosdr-project/bin/osmo-sdr-test-osmo-sdr-at91sam3u4-dfu.bin
}}}
Convert FPGA image:
{{{
utils/vmelinearize$ ./vmelin ../../fpga/hw-v2/deploy/usbrx_algo.vme ../../fpga/hw-v2/deploy/usbrx_data.vme > /tmp/fpga.out
}}}
Flash the FPGA partition
{{{
dfu-util -d 16c0:0763 -i0 -a3 -D /tmp/fpga.out
}}}
ignore "Error during download"