patch #8719: Support Over-the-Air bootloading with XBeeBoot

Submitted by David Sainty:
* xbee.c: New programmer
* xbee.h: (Dito.)
* pgm_type.c: Add xbee.h
* avrdude.conf.in (xbee): New programmer
* Makefile.am (libavrdude_a_SOURCES): add xbee.c, xbee.h
* avrdude.1: document the new programmer
* doc/avrdude.texi: (Dito.)




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1477 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2021-11-22 21:35:26 +00:00
parent 9a15fcb25f
commit 8004e38403
10 changed files with 1905 additions and 4 deletions

View File

@ -25,6 +25,7 @@ Contributors:
Jim Paris <jim@jtan.com>
Jan Egil Ruud <janegil.ruud@microchip.com>
David Mosberger-Tang
David Sainty
For minor contributions, please see the ChangeLog files.

View File

@ -1,3 +1,15 @@
2021-11-22 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
Submitted by David Sainty:
patch #8719: Support Over-the-Air bootloading with XBeeBoot
* xbee.c: New programmer
* xbee.h: (Dito.)
* pgm_type.c: Add xbee.h
* avrdude.conf.in (xbee): New programmer
* Makefile.am (libavrdude_a_SOURCES): add xbee.c, xbee.h
* avrdude.1: document the new programmer
* doc/avrdude.texi: (Dito.)
2021-11-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
Submitted by Ivan Frederiks:

View File

@ -190,7 +190,9 @@ libavrdude_a_SOURCES = \
usbtiny.c \
update.c \
wiring.h \
wiring.c
wiring.c \
xbee.h \
xbee.c
libavrdude_la_SOURCES = $(libavrdude_a_SOURCES)
libavrdude_la_LDFLAGS = -version-info 1:0

2
NEWS
View File

@ -47,6 +47,7 @@ Current:
- linuxspi (direct SPI bus e.g. on Raspberry Pi devices)
- PICkit4, Snap, PKoB
- iseavrprog
- XBeeBoot
* Bugfixes:
bug #47550: Linux GPIO broken
@ -110,6 +111,7 @@ Current:
patch #9079: Fix ftdi_syncbb teardown (supersedes #9893)
patch #9122: Fixed MISO sampling in ftdi_syncbb
patch #9123: ftdi_syncbb: use FT245R_CYCLES in ft245r_set_bitclock()
patch #8719: Support Over-the-Air bootloading with XBeeBoot
* Internals:
- New avrdude.conf keyword "family_id", used to verify SIB attributes

View File

@ -18,7 +18,7 @@
.\"
.\" $Id$
.\"
.Dd DATE September 19, 2020
.Dd DATE November 22, 2021
.Os
.Dt AVRDUDE 1
.Sh NAME
@ -531,6 +531,22 @@ location in the USB hierarchy. See the the respective
.Em Troubleshooting
entry in the detailed documentation for examples.
.Pp
For the XBee programmer the target MCU is to be programmed wirelessly over a
ZigBee mesh using the XBeeBoot bootloader. The ZigBee 64-bit address for the
target MCU's own XBee device must be supplied as a 16-character hexadecimal
value as a
.Ar port
prefix, followed by the
.Ql @
character, and the serial device to connect to a second directly contactable
XBee device associated with the same mesh (with a default baud rate of 9600).
This may look similar to:
.Pa 0013a20000000001@/dev/tty.serial .
.Pp
For diagnostic purposes, if the target MCU with an XBeeBoot bootloader is
connected directly to the serial port, the 64-bit address field can be
omitted. In this mode the default baud rate will be 19200.
.Pp
For programmers that attach to a serial port using some kind of
higher level protocol (as opposed to bit-bang style programmers),
.Ar port
@ -1100,6 +1116,23 @@ Programmer will erase configuration section with option
(chip erase), rather than entire chip.
Only applicable to TPI devices (ATtiny 4/5/9/10/20/40).
.El
.It Ar xbee
Extended parameters:
.Bl -tag -offset indent -width indent
.It Ar xbeeresetpin=<1..7>
Select the XBee pin DIO<1..7> that is connected to the MCU's
.Ql /RESET
line. The programmer needs to know which DIO pin to use to reset into the
bootloader. The default (3) is the DIO3 pin (XBee pin 17), but some
commercial products use a different XBee pin.
.Pp
The remaining two necessary XBee-to-MCU connections are not selectable - the
XBee DOUT pin (pin 2) must be connected to the MCU's
.Ql RXD
line, and the XBee DIN pin (pin 3) must be connected to the MCU's
.Ql TXD
line.
.El
.El
.Sh FILES
.Bl -tag -offset indent -width /dev/ppi0XXX

View File

@ -363,6 +363,14 @@ programmer
type = "arduino";
connection_type = serial;
;
programmer
id = "xbee";
desc = "XBee Series 2 Over-The-Air (XBeeBoot)";
type = "xbee";
connection_type = serial;
;
# this will interface with the chips on these programmers:
#
# http://real.kiev.ua/old/avreal/en/adapters

View File

@ -30,7 +30,7 @@ For avrdude version @value{VERSION}, @value{UPDATED}.
Copyright @copyright{} 2003, 2005 Brian Dean
Copyright @copyright{} 2006 - 2016 J@"org Wunsch
Copyright @copyright{} 2006 - 2021 J@"org Wunsch
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@ -584,7 +584,22 @@ and Mac OS but not on Windows. For more information about AVR-Doper see
For the USBtinyISP, which is a simplistic device not implementing
serial numbers, multiple devices can be distinguished by their
location in the USB hierarchy.
@xref{Troubleshooting}, for examples.
See the respective
@xref{Troubleshooting} entry for examples.
For the XBee programmer the target MCU is to be programmed wirelessly
over a ZigBee mesh using the XBeeBoot bootloader. The ZigBee 64-bit
address for the target MCU's own XBee device must be supplied as a
16-character hexadecimal value as a port prefix, followed by the
@code{@@} character, and the serial device to connect to a second
directly contactable XBee device associated with the same mesh (with
a default baud rate of 9600). This may look similar to:
@code{0013a20000000001@/dev/tty.serial}.
For diagnostic purposes, if the target MCU with an XBeeBoot
bootloader is connected directly to the serial port, the
64-bit address field can be omitted. In this mode the
default baud rate will be 19200.
For programmers that attach to a serial port using some kind of
higher level protocol (as opposed to bit-bang style programmers),
@ -959,6 +974,22 @@ rather than entire chip.
Only applicable to TPI devices (ATtiny 4/5/9/10/20/40).
@end table
@item xbee
Extended parameters:
@table @code
@item @samp{xbeeresetpin=@var{1..7}}
Select the XBee pin @code{DIO<1..7>} that is connected to the MCU's
/RESET line. The programmer needs to know which DIO pin to use to
reset into the bootloader. The default (3) is the @code{DIO3} pin
(XBee pin 17), but some commercial products use a different XBee
pin.
The remaining two necessary XBee-to-MCU connections are not selectable
- the XBee @code{DOUT} pin (pin 2) must be connected to the MCU's
RXD line, and the XBee @code{DIN} pin (pin 3) must be connected to
the MCU's TXD line.
@end table
@end table
@page

View File

@ -51,6 +51,7 @@
#include "usbasp.h"
#include "usbtiny.h"
#include "wiring.h"
#include "xbee.h"
const PROGRAMMER_TYPE programmers_types[] = {
@ -97,6 +98,7 @@ const PROGRAMMER_TYPE programmers_types[] = {
{"usbasp", usbasp_initpgm, usbasp_desc},
{"usbtiny", usbtiny_initpgm, usbtiny_desc},
{"wiring", wiring_initpgm, wiring_desc},
{"xbee", xbee_initpgm, xbee_desc},
};
const PROGRAMMER_TYPE * locate_programmer_type(const char * id)

1783
xbee.c Normal file

File diff suppressed because it is too large Load Diff

27
xbee.h Normal file
View File

@ -0,0 +1,27 @@
/*
* avrdude - A Downloader/Uploader for AVR device programmers
* Copyright (C) 2015-2020 David Sainty
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* $Id$ */
#ifndef xbee_h__
#define xbee_h__
extern const char xbee_desc[];
void xbee_initpgm (PROGRAMMER * pgm);
#endif