This repository has been archived on 2022-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-sdr/firmware/usb-dfu-project
Harald Welte dc23dc5a81 include auto-generated GIT_REVISION into the DFU and firmware builds
At the moment it is only shown on the serial console, though.
2012-06-25 15:09:55 +02:00
..
bin import DFU loader for at91sam3u-ek / osmo-sdr 2012-01-15 20:57:36 +01:00
obj import DFU loader for at91sam3u-ek / osmo-sdr 2012-01-15 20:57:36 +01:00
Makefile include auto-generated GIT_REVISION into the DFU and firmware builds 2012-06-25 15:09:55 +02:00
README add README for DFU 2012-01-15 21:17:27 +01:00
dfu_desc.h import DFU loader for at91sam3u-ek / osmo-sdr 2012-01-15 20:57:36 +01:00
hardware.c added DFU functionality for the FPGA - crudely removed stuff from the loader to make it fit into the 16k 2012-05-17 22:47:51 +02:00
hardware.h added DFU functionality for the FPGA - crudely removed stuff from the loader to make it fit into the 16k 2012-05-17 22:47:51 +02:00
main.c include auto-generated GIT_REVISION into the DFU and firmware builds 2012-06-25 15:09:55 +02:00
opcode.h added DFU functionality for the FPGA - crudely removed stuff from the loader to make it fit into the 16k 2012-05-17 22:47:51 +02:00
sam3u_chipid_usbserial.c import DFU loader for at91sam3u-ek / osmo-sdr 2012-01-15 20:57:36 +01:00
slimpro.c added DFU functionality for the FPGA - crudely removed stuff from the loader to make it fit into the 16k 2012-05-17 22:47:51 +02:00
usb_strings.h import DFU loader for at91sam3u-ek / osmo-sdr 2012-01-15 20:57:36 +01:00
usb_strings.txt import DFU loader for at91sam3u-ek / osmo-sdr 2012-01-15 20:57:36 +01:00

README

This builds a USB DFU compatible boot loader for sam3u based boards.

try
	make BOARD=at91sam3u-ek
or
	make BOARD=osmo-sdr
depending on your board type.

The result is a < 16kBytes file in the ./bin/ subdirectory, which you can
flash using JTAG, SAM-BA or rum-ba to the beginning of FLASH0.

The DFU loader will check in early boot if the "DFU button" is set.  If yes,
it will enter the DFU mode, if not it continuest to boot directly the
application.

DFU button mappings:
	at91sam3u-ek:	Button marked PB-LEFT on the board
	osmo-sdr:	PA12 (can be closed with a jumper on the header)

The regular application program can change from run-time to DFU mode quite
easily.  In fact, this happens using a standardized USB control request and is
thus already implemented in the at91lib.git on git.gnumonks.org.

You can switch the device from runtime into DFU mode using
	dfu-util -e -d 0x16c0:0x0763

After that, you can flash a new application image into the respective partition using
	dfu-util -d 0x16c0:0x0763 -a0 -D ./bin/my-foobar-project-dfu.bin

which should show something like:

Opening DFU capable USB device... ID 16c0:0763
Run-time device DFU version 0100
Found DFU: [16c0:0763] devnum=0, cfg=1, intf=0, alt=0, name="OsmoSDR DFU Interface - Application Partition"
[...]
Starting download: [##################################################] finished!
state(7) = dfuMANIFEST, status(0) = No error condition is present
state(2) = dfuIDLE, status(0) = No error condition is present


However, that application has to be built using a compatible linker script.

building application firmware for DFU
=====================================

This needs a special linker script which is implemented as dfu.lds in the
at91lib repository on git.gnumonks.org.  You can then build your project to
get linked to the "application partition" using
	make dfu
in the respective project directory

There is a 'usb-fast-audi-source' project that can be used for demonstration
purpose, it has 'make BOARD=osmo-sdr dfu' support