1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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:
Marian Buschsieweke 2020-02-10 14:59:24 +01:00
parent 88b90ee4af
commit c1c25b0644
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
2 changed files with 26 additions and 15 deletions

View File

@ -3,18 +3,7 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
PROGRAMMER ?= arduino
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)
ARDUINO_NANO_BOOTLOADER ?= atmegaboot
BOOTLOADER ?= $(ARDUINO_NANO_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -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) |
| 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
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
flash
##Caution
## 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
Don't expect having a working network stack due to very limited resources.
*/