diff --git a/boards/atmega256rfr2-xpro/Makefile.include b/boards/atmega256rfr2-xpro/Makefile.include index 3f55b658d4..1da4566356 100644 --- a/boards/atmega256rfr2-xpro/Makefile.include +++ b/boards/atmega256rfr2-xpro/Makefile.include @@ -1,7 +1,7 @@ # configure the terminal program PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) -BAUD ?= 9600 +BAUD ?= 115200 include $(RIOTMAKE)/tools/serial.inc.mk # Use EDBG (xplainedpro) programmer with avrdude diff --git a/boards/atmega256rfr2-xpro/doc.txt b/boards/atmega256rfr2-xpro/doc.txt index 1c7d677cad..1ac5d747a4 100644 --- a/boards/atmega256rfr2-xpro/doc.txt +++ b/boards/atmega256rfr2-xpro/doc.txt @@ -11,7 +11,20 @@ is an evaluation kit by Microchip for their ATmega256RFR2 microcontroller. ### Flash the board You can flash the board using the on-board EDBG programmer via JTAG. Avrdude has -support for programming an AVR via EDBG with its xplainedpro programmer: +support for programming an AVR via EDBG with its xplainedpro programmer. + +First, make sure the default fuse settings are correct. In particular, the low +byte fuse are enabling the use of the on-board 16MHz external oscillator.
+ +WARNING: setting the fuses incorrectly can brick your board! +``` +avrdude -p m256rfr2 -c xplainedpro -U efuse:w:0xFF:m +avrdude -p m256rfr2 -c xplainedpro -U hfuse:w:0x1F:m +avrdude -p m256rfr2 -c xplainedpro -U lfuse:w:0xFF:m +``` + +To flash the board, just call `make` from an application directory with the +`flash` target: ``` make BOARD=atmega256rfr2-xpro -C examples/hello-world flash diff --git a/boards/atmega256rfr2-xpro/include/board.h b/boards/atmega256rfr2-xpro/include/board.h index 327958937e..7e4edde9fa 100644 --- a/boards/atmega256rfr2-xpro/include/board.h +++ b/boards/atmega256rfr2-xpro/include/board.h @@ -26,16 +26,6 @@ extern "C" { #endif -/** - * @name STDIO configuration - * - * As the CPU is too slow to handle 115200 baud, we set the default - * baudrate to 9600 for this board - * @{ - */ -#define STDIO_UART_BAUDRATE (9600U) -/** @} */ - /** * @brief Use the UART 1 for STDIO on this board */ @@ -44,13 +34,11 @@ extern "C" { /** * @name xtimer configuration values * - * Xtimer runs at 8MHz / 64 = 125kHz + * Xtimer runs at 16MHz / 64 = 250kHz * @{ */ -#define XTIMER_DEV (0) -#define XTIMER_CHAN (0) #define XTIMER_WIDTH (16) -#define XTIMER_HZ (125000UL) +#define XTIMER_HZ (250000UL) #define XTIMER_BACKOFF (40) /** @} */ diff --git a/boards/atmega256rfr2-xpro/include/periph_conf.h b/boards/atmega256rfr2-xpro/include/periph_conf.h index 5c65b2290c..62e7770726 100644 --- a/boards/atmega256rfr2-xpro/include/periph_conf.h +++ b/boards/atmega256rfr2-xpro/include/periph_conf.h @@ -19,24 +19,14 @@ #ifndef PERIPH_CONF_H #define PERIPH_CONF_H +#include "periph_conf_atmega_common.h" + #ifdef __cplusplus extern "C" { #endif -/** - * @name Clock configuration - * @{ - */ -#ifndef CLOCK_CORECLOCK -/* Using 8MHz internal oscillator as default clock source */ -#define CLOCK_CORECLOCK (8000000UL) -#endif -/** @} */ - #ifdef __cplusplus } #endif -#include "periph_conf_atmega_common.h" - #endif /* PERIPH_CONF_H */ diff --git a/tests/periph_gpio/tests/02-bench.py b/tests/periph_gpio/tests/02-bench.py index e1cc79c21f..ea2d00371a 100755 --- a/tests/periph_gpio/tests/02-bench.py +++ b/tests/periph_gpio/tests/02-bench.py @@ -10,6 +10,10 @@ import sys from testrunner import run +# On slow platforms, like AVR, this test can take some time to complete. +TIMEOUT = 30 + + def testfunc(child): child.expect_exact("GPIO peripheral driver test") child.expect_exact(">") @@ -33,4 +37,4 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(run(testfunc, timeout=10)) + sys.exit(run(testfunc, timeout=TIMEOUT)) diff --git a/tests/periph_timer/Makefile b/tests/periph_timer/Makefile index 1f00d7726a..2e68164141 100644 --- a/tests/periph_timer/Makefile +++ b/tests/periph_timer/Makefile @@ -7,6 +7,7 @@ BOARDS_TIMER_25kHz := \ arduino-leonardo \ arduino-mega2560 \ arduino-uno \ + atmega256rfr2-xpro \ atmega328p \ waspmote-pro \ #