1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 18:57:11 +02:00
ben-wpan/atusb/fw
Josef Filzmaier ea23c905d3 atusb/fw: Introduction of a new board named HULUSB
The Busware HUL v1.1 dongle is a product very similar
to the rzusb dongle but with the at86rf212 instead of
the at86rf230 transceiver.

Some code refactoring has been made in order to better
support multiple hardware targets. This includes:

The reset_rf functions are now in the board specific files.
The led functions are now in the board specific files.
The register read/write functions are moved from mac.c to the generic
board.c file as they are used by functions like reset_rf that are
not within the mac.c file. Also the subreg_read and subreg_write
functions were introduced for convenience.
The function to change state is now also in board.c.

The hardware types are moved into the atusb.h file (which is always
synchrornized with the linux atusb driver) because they are now used
by the driver to identify and configure the hardware.

Within the makefile a new target name is specified called: hulusb

Signed-off-by: Josef Filzmaier <j.filzmaier@gmx.at>
2017-09-13 17:45:54 +02:00
..
an moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
include atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
usb atusb: fw: re-factor SPI, USB and board_app code for board specifics 2016-03-30 22:24:17 +02:00
atusb.c atusb/fw: Introduce DEBUG flag 2017-09-13 17:45:54 +02:00
board_app.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
board_atusb.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
board_atusb.h atusb: fw: re-factor SPI, USB and board_app code for board specifics 2016-03-30 22:24:17 +02:00
board_hulusb.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
board_hulusb.h atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
board_rzusb.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
board_rzusb.h atusb: fw: re-factor SPI, USB and board_app code for board specifics 2016-03-30 22:24:17 +02:00
board.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
board.h atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
boot.c atusb/fw/boot.c: adjusted the delay loop and don't race with dfu-util 2011-06-11 14:26:52 -03:00
descr.c atusb/fw/: support alternative interface names with DFU 2014-03-25 20:54:09 -03:00
ep0.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
flash.c flashi/spi: Use tabs instead of spaces. 2015-06-09 22:43:32 +02:00
mac.c atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
mac.h atusb/fw/: echo back TX ACK sequence number; don't panic if driver times out TX 2013-04-01 22:04:05 -03:00
Makefile atusb/fw: Introduction of a new board named HULUSB 2017-09-13 17:45:54 +02:00
README atusb/fw/README: boot loader flashing time was a bit too optimistic (15 -> 30 s) 2011-05-09 23:44:51 -03:00
sernum.c atusb/fw/: convert functions returning "int" to "bool" 2013-03-29 19:14:11 -03:00
sernum.h atusb/fw/: convert functions returning "int" to "bool" 2013-03-29 19:14:11 -03:00
spi.c atusb: fw: re-factor SPI, USB and board_app code for board specifics 2016-03-30 22:24:17 +02:00
spi.h atusb/fw/: add SPI block reception 2013-07-30 19:52:54 -03:00
uart.c atusb/fw: Introduce DEBUG flag 2017-09-13 17:45:54 +02:00
uart.h atusb/fw: Introduce DEBUG flag 2017-09-13 17:45:54 +02:00
version.h moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00

Requires a very recent toolchain, because ATmega32U2 is relatively new.

- Building:

  make

- Uploading the firmware to a Ben (for flashing with the atusb-pgm cable):

  make HOST=<hostname> upload

  Example:

  make HOST=ben upload

  HOST defaults to "jlime".

- Flashing the boot loader:

  Prerequisite: avrdude on the Ben.

  Disconnect the atusb board from USB. Insert the atusb-pgm connector into
  the Ben. Place the atusb-pgm adapter on the exposed contact pads of the
  atusb board and push it down. Then run

  make prog

  This takes about 30 seconds. If the programming fails with an error
  message like "Yikes!  Invalid device signature.", verify that the
  atusb-pgm board is properly connected and placed, then try again.

- Uploading the application:

  Prerequisite: dfu-util installed on the PC.

  Insert atusb into the PC, then run

  make dfu

  Note: since the boot loader resets the USB bus after timing out,
  this operation can fail with a message like "No DFU capable USB device
  found". Just retry, and it will eventually get through.

--------------------------

Making the toolchain:

# patches according to
# http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=789527

# some gcc prerequisites

apt-get remove avr-libc gcc-avr binutils-avr
apt-get install libmpfr-dev libmpc-dev

# binutils

wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
tar xfj binutils-2.21.tar.bz2 
cd binutils-2.21
./configure --target=avr --disable-nls
make
make install

# gcc

wget http://ftpmirror.gnu.org/gcc/gcc-4.5.2/gcc-4.5.2.tar.bz2
wget -O gcc_452_avr.patch http://gcc.gnu.org/bugzilla/attachment.cgi?id=23050
tar xfj gcc-4.5.2.tar.bz2
cd gcc-4.5.2
patch -p1 -s <../gcc_452_avr.patch
mkdir obj-avr
cd obj-avr
../configure --target=avr --enable-languages=c \
    --disable-nls --disable-libssp --with-dwarf2
make
make install

wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.1.tar.bz2
tar xfj avr-libc-1.7.1.tar.bz2 
cd avr-libc-1.7.1
./bootstrap	# the automake at the end takes a while
./configure --build=`./config.guess` --host=avr
make
make install