Skip to content

Commit cd298b9

Browse files
authored
Merge pull request #12649 from aabadie/pr/boards/atmega256rfr2-xpro_fixes
boards/atmega256rfr2-xpro: update clock configuration/stdio baudrate + a test timeout
2 parents d02ed3a + bd39ce3 commit cd298b9

File tree

6 files changed

+25
-29
lines changed

6 files changed

+25
-29
lines changed

boards/atmega256rfr2-xpro/Makefile.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# configure the terminal program
22
PORT_LINUX ?= /dev/ttyACM0
33
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
4-
BAUD ?= 9600
4+
BAUD ?= 115200
55
include $(RIOTMAKE)/tools/serial.inc.mk
66

77
# Use EDBG (xplainedpro) programmer with avrdude

boards/atmega256rfr2-xpro/doc.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,20 @@ is an evaluation kit by Microchip for their ATmega256RFR2 microcontroller.
1111
### Flash the board
1212

1313
You can flash the board using the on-board EDBG programmer via JTAG. Avrdude has
14-
support for programming an AVR via EDBG with its xplainedpro programmer:
14+
support for programming an AVR via EDBG with its xplainedpro programmer.
15+
16+
First, make sure the default fuse settings are correct. In particular, the low
17+
byte fuse are enabling the use of the on-board 16MHz external oscillator.<br/>
18+
19+
WARNING: setting the fuses incorrectly can brick your board!
20+
```
21+
avrdude -p m256rfr2 -c xplainedpro -U efuse:w:0xFF:m
22+
avrdude -p m256rfr2 -c xplainedpro -U hfuse:w:0x1F:m
23+
avrdude -p m256rfr2 -c xplainedpro -U lfuse:w:0xFF:m
24+
```
25+
26+
To flash the board, just call `make` from an application directory with the
27+
`flash` target:
1528

1629
```
1730
make BOARD=atmega256rfr2-xpro -C examples/hello-world flash

boards/atmega256rfr2-xpro/include/board.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626
extern "C" {
2727
#endif
2828

29-
/**
30-
* @name STDIO configuration
31-
*
32-
* As the CPU is too slow to handle 115200 baud, we set the default
33-
* baudrate to 9600 for this board
34-
* @{
35-
*/
36-
#define STDIO_UART_BAUDRATE (9600U)
37-
/** @} */
38-
3929
/**
4030
* @brief Use the UART 1 for STDIO on this board
4131
*/
@@ -44,13 +34,11 @@ extern "C" {
4434
/**
4535
* @name xtimer configuration values
4636
*
47-
* Xtimer runs at 8MHz / 64 = 125kHz
37+
* Xtimer runs at 16MHz / 64 = 250kHz
4838
* @{
4939
*/
50-
#define XTIMER_DEV (0)
51-
#define XTIMER_CHAN (0)
5240
#define XTIMER_WIDTH (16)
53-
#define XTIMER_HZ (125000UL)
41+
#define XTIMER_HZ (250000UL)
5442
#define XTIMER_BACKOFF (40)
5543
/** @} */
5644

boards/atmega256rfr2-xpro/include/periph_conf.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,14 @@
1919
#ifndef PERIPH_CONF_H
2020
#define PERIPH_CONF_H
2121

22+
#include "periph_conf_atmega_common.h"
23+
2224
#ifdef __cplusplus
2325
extern "C" {
2426
#endif
2527

26-
/**
27-
* @name Clock configuration
28-
* @{
29-
*/
30-
#ifndef CLOCK_CORECLOCK
31-
/* Using 8MHz internal oscillator as default clock source */
32-
#define CLOCK_CORECLOCK (8000000UL)
33-
#endif
34-
/** @} */
35-
3628
#ifdef __cplusplus
3729
}
3830
#endif
3931

40-
#include "periph_conf_atmega_common.h"
41-
4232
#endif /* PERIPH_CONF_H */

tests/periph_gpio/tests/02-bench.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from testrunner import run
1111

1212

13+
# On slow platforms, like AVR, this test can take some time to complete.
14+
TIMEOUT = 30
15+
16+
1317
def testfunc(child):
1418
child.expect_exact("GPIO peripheral driver test")
1519
child.expect_exact(">")
@@ -33,4 +37,4 @@ def testfunc(child):
3337

3438

3539
if __name__ == "__main__":
36-
sys.exit(run(testfunc, timeout=10))
40+
sys.exit(run(testfunc, timeout=TIMEOUT))

tests/periph_timer/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ BOARDS_TIMER_25kHz := \
77
arduino-leonardo \
88
arduino-mega2560 \
99
arduino-uno \
10+
atmega256rfr2-xpro \
1011
atmega328p \
1112
waspmote-pro \
1213
#

0 commit comments

Comments
 (0)