boards/arduino-nano: Refactor avrdude conf
- Use the common logic to translate from a bootloader to concrete flasher flags - Extended documentation on how to use optiboot as alternative bootloader, as the stock bootloader is affected by a bug preventing the use of RIOT's pm_reboot() implementation
This commit is contained in:
parent
88b90ee4af
commit
c1c25b0644
@ -3,18 +3,7 @@ PORT_LINUX ?= /dev/ttyUSB0
|
|||||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||||
BAUD ?= 9600
|
BAUD ?= 9600
|
||||||
|
|
||||||
PROGRAMMER ?= arduino
|
ARDUINO_NANO_BOOTLOADER ?= atmegaboot
|
||||||
|
BOOTLOADER ?= $(ARDUINO_NANO_BOOTLOADER)
|
||||||
ifeq (arduino,$(PROGRAMMER))
|
|
||||||
# the Arduino Nano bootloader is 2KiB in size
|
|
||||||
BOOTLOADER_SIZE ?= 2048
|
|
||||||
# the Nano's bootloader uses 57600 baud for programming
|
|
||||||
FFLAGS_EXTRA += -b 57600
|
|
||||||
else
|
|
||||||
# not using the bootloader for programming, thus the whole flash can be used
|
|
||||||
BOOTLOADER_SIZE ?= 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
|
|
||||||
|
|
||||||
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include
|
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include
|
||||||
|
|||||||
@ -26,7 +26,7 @@ extensible by using shields.
|
|||||||
| MCU Datasheet | [ATmega328p datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) |
|
| MCU Datasheet | [ATmega328p datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) |
|
||||||
| Board Manual | [Board Manual](https://www.arduino.cc/en/uploads/Main/ArduinoNanoManual23.pdf) |
|
| Board Manual | [Board Manual](https://www.arduino.cc/en/uploads/Main/ArduinoNanoManual23.pdf) |
|
||||||
|
|
||||||
## Flashing the device
|
## Flashing the Device
|
||||||
Flashing RIOT on the Arduino Nano is quite straight forward, just connect your
|
Flashing RIOT on the Arduino Nano is quite straight forward, just connect your
|
||||||
Arduino Nano via the USB connector to your host computer and type:
|
Arduino Nano via the USB connector to your host computer and type:
|
||||||
|
|
||||||
@ -37,6 +37,28 @@ This should take care of everything!
|
|||||||
We use the open `avrdude` tool to write the new code into the ATmega328p's
|
We use the open `avrdude` tool to write the new code into the ATmega328p's
|
||||||
flash
|
flash
|
||||||
|
|
||||||
|
## Using Optiboot
|
||||||
|
|
||||||
|
You can use the [Optiboot](https://github.com/Optiboot/optiboot) bootloader
|
||||||
|
instead of the stock bootloader for faster programming. Optiboot also is
|
||||||
|
smaller (512 byte instead of 2 KiB), so that 1.5 KiB more program memory is
|
||||||
|
available for RIOT. Refer to the project page for instructions on how to
|
||||||
|
build an flash the bootloader. Don't forgot to also update the fuse settings
|
||||||
|
to set the bootloader size to 256 words (512 bytes).
|
||||||
|
|
||||||
|
Compile and flash with `make BOARD=arduino-nano BOOTLOADER=optiboot flash` or
|
||||||
|
use `export ARDUINO_NANO_BOOTLOADER=optiboot` in order to not have to specify
|
||||||
|
the bootloader during compilation and flashing.
|
||||||
|
|
||||||
|
## Issues
|
||||||
|
|
||||||
|
### RIOT Stuck in Reboot Loop
|
||||||
|
|
||||||
|
If RIOT is stuck in a reboot loop e.g. after restarting the device with the
|
||||||
|
`reboot` shell command, this is likely caused by an
|
||||||
|
[issue with the stock bootloader](https://forum.arduino.cc/index.php?topic=150419.0)
|
||||||
|
that can be solved by using Optiboot as bootloader instead (see above).
|
||||||
|
|
||||||
## Caution
|
## Caution
|
||||||
Don't expect having a working network stack due to very limited resources.
|
Don't expect having a working network stack due to very limited resources.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user