Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,17 @@ ifneq (,$(filter stdio_cdc_acm stdio_null stdio_uart slipdev_stdio,$(USEMODULE))
DISABLE_MODULE += stdio_rtt
endif

ifneq (,$(filter stdio_rtt stdio_null stdio_uart slipdev_stdio,$(USEMODULE)))
# stdio_cdc_acm cannot be used when another STDIO is loaded
DISABLE_MODULE += stdio_cdc_acm
endif

ifeq (,$(filter stdio_cdc_acm,$(USEMODULE)))
# The arduino bootloader feature cannot be used if the stdio_cdc_acm module
# is not used
FEATURES_BLACKLIST += bootloader_arduino
endif

ifneq (,$(filter isrpipe,$(USEMODULE)))
USEMODULE += tsrb
endif
Expand Down
21 changes: 12 additions & 9 deletions boards/arduino-mkrfox1200/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ powered by an Atmel SAMD21 microcontroller.

### Flash the board

1. Put the board in bootloader mode by double tapping the reset button.<br/>
When the board is in bootloader mode, the user led (green) oscillates
smoothly.


2. Use `BOARD=arduino-mkrfox1200` with the `make` command.<br/>
Example with `hello-world` application:
Use `BOARD=arduino-mkrfox1200` with the `make` command.<br/>
Example with `hello-world` application:
```
make BOARD=arduino-mkrfox1200 -C examples/hello-world flash
```

@note If the application crashes, automatic reflashing via USB, as explained
above won't be possible. In this case, the board must be set in
bootloader mode by double tapping the reset button before running the
flash command.

### Accessing STDIO via UART

To access the STDIO of RIOT, a FTDI to USB converter needs to be plugged to
the RX/TX pins on the board.
STDIO of RIOT is directly available over the USB port.

The `TERM_DELAY` environment variable can be used to add a delay (in second)
before opening the serial terminal. The default value is 2s which should be
enough in most of the situation.
*/
70 changes: 35 additions & 35 deletions boards/arduino-mkrwan1300/doc.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
/**
* @defgroup boards_arduino-mkrwan1300 Arduino MKR WAN 1300
* @ingroup boards
* @brief Support for the Arduino MKR WAN 1300 board.
*
* ### General information
*
* The [Arduino MKR WAN 1300](https://store.arduino.cc/mkr-wan-1300) board is
* a learning and development board that provides LoRa connectivity and is
* powered by an Atmel SAMD21 microcontroller.
*
* ### Pinout
*
* <img src="https://www.arduino.cc/en/uploads/Main/MKR1000_pinout.png"
* alt="Arduino MKR WAN 1300 pinout" style="height:800px;"/>
*
* ### Flash the board
*
* 1. Put the board in bootloader mode by double tapping the reset button.<br/>
* When the board is in bootloader mode, the user led (amber) oscillates
* smoothly.
*
*
* 2. Use `BOARD=arduino-mkrwan1300` with the `make` command.<br/>
* Example with `hello-world` application:
* ```
* make BOARD=arduino-mkrwan1300 -C examples/hello-world flash
* ```
*
* @warning Unplug the board from the anti-static protective foam before
* starting to use it otherwise it may not work as expected.
*
* ### Accessing STDIO via UART
*
* To access the STDIO of RIOT, a FTDI to USB converted needs to be plugged to
* the RX/TX pins on the board.
@defgroup boards_arduino-mkrwan1300 Arduino MKR WAN 1300
@ingroup boards
@brief Support for the Arduino MKR WAN 1300 board.

### General information

The [Arduino MKR WAN 1300](https://store.arduino.cc/mkr-wan-1300) board is
a learning and development board that provides LoRa connectivity and is
powered by an Atmel SAMD21 microcontroller.

### Pinout

<img src="https://www.arduino.cc/en/uploads/Main/MKR1000_pinout.png"
alt="Arduino MKR WAN 1300 pinout" style="height:800px;"/>

### Flash the board

Use `BOARD=arduino-mkrgsm1400` with the `make` command.<br/>
Example with `hello-world` application:
```
make BOARD=arduino-mkrgsm1400 -C examples/hello-world flash
```

@note If the application crashes, automatic reflashing via USB, as explained
above won't be possible. In this case, the board must be set in
bootloader mode by double tapping the reset button before running the
flash command.

### Accessing STDIO via UART

STDIO of RIOT is directly available over the USB port.

The `TERM_DELAY` environment variable can be used to add a delay (in second)
before opening the serial terminal. The default value is 2s which should be
enough in most of the situation.
*/
3 changes: 3 additions & 0 deletions boards/common/arduino-mkr/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.dep
1 change: 1 addition & 0 deletions boards/common/arduino-mkr/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pwm
FEATURES_PROVIDED += bootloader_arduino
9 changes: 3 additions & 6 deletions boards/common/arduino-mkr/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ ifeq ($(PROGRAMMER),jlink)
# in case J-Link is attached to SWD pins, use a plain CPU memory model
JLINK_DEVICE = $(MKR_JLINK_DEVICE)
include $(RIOTMAKE)/tools/jlink.inc.mk
else
# by default, we use BOSSA to flash this board and take into account the
# preinstalled Arduino bootloader. ROM_OFFSET skips the space taken by
# such bootloader.
ROM_OFFSET ?= 0x2000
include $(RIOTMAKE)/tools/bossa.inc.mk
endif

# Include all definitions for flashing with bossa over USB
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.include

INCLUDES += -I$(RIOTBOARD)/common/arduino-mkr/include
3 changes: 3 additions & 0 deletions boards/common/samd21-arduino-bootloader/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = boards_common_samd21-arduino-bootloader

include $(RIOTBASE)/Makefile.base
13 changes: 13 additions & 0 deletions boards/common/samd21-arduino-bootloader/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Provide stdio over USB by default
# This is a temporary solution until management of stdio is correctly
# handled by the build system
DEFAULT_MODULE += stdio_cdc_acm

# Default auto-initialization of usbus for stdio other USB
USEMODULE += auto_init_usbus

# This boards requires support for Arduino bootloader.
USEMODULE += usb_board_reset
USEMODULE += boards_common_samd21-arduino-bootloader

FEATURES_REQUIRED += bootloader_arduino
31 changes: 31 additions & 0 deletions boards/common/samd21-arduino-bootloader/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# setup the flash tool used
# Bossa is the default programmer
PROGRAMMER ?= bossa

ifeq ($(PROGRAMMER),bossa)
# by default, we use BOSSA to flash this board and take into account the
# preinstalled Arduino bootloader. ROM_OFFSET skips the space taken by
# such bootloader.
ROM_OFFSET ?= 0x2000
BOSSA_ARDUINO_PREFLASH = yes
PREFLASH_DELAY = 1

ifneq (,$(filter reset flash flash-only, $(MAKECMDGOALS)))
# By default, add 2 seconds delay before opening terminal: this is required
# when opening the terminal right after flashing. In this case, the stdio
# over USB needs some time after reset before being ready.
TERM_DELAY ?= 2
TERMDEPS += term-delay
endif

include $(RIOTMAKE)/tools/bossa.inc.mk
endif

term-delay:
sleep $(TERM_DELAY)

TESTRUNNER_CONNECT_DELAY ?= $(TERM_DELAY)
$(call target-export-variables,test,TESTRUNNER_CONNECT_DELAY)

# Add the samd21-arduino-bootloader directory to the build
DIRS += $(RIOTBOARD)/common/samd21-arduino-bootloader
43 changes: 43 additions & 0 deletions boards/common/samd21-arduino-bootloader/reset.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (C) 2019 Inria
* 2019 Kees Bakker, SODAQ
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_common
* @{
* @file
* @brief Board common implementations for managing an Arduino bootloader
*
* @author Alexandre Abadie <[email protected]>
* @author Kees Bakker <[email protected]>
*
* @}
*/

#define USB_H_USER_IS_RIOT_INTERNAL

#include "usb_board_reset.h"


#define SAMD21_DOUBLE_TAP_ADDR (0x20007FFCUL)
#define SAMD21_DOUBLE_TAP_MAGIC_NUMBER (0x07738135UL)

void usb_board_reset_in_bootloader(void)
{
/* The Arduino bootloader checks for a magic number in SRAM to remain in
bootloader mode.
See
https://github.com/arduino/ArduinoCore-samd/blob/master/bootloaders/zero/board_definitions_arduino_mkr1000.h#L38
and
https://github.com/arduino/ArduinoCore-samd/blob/master/bootloaders/zero/main.c#L94
for implementation details. */
uint32_t *reset_addr = (uint32_t *)SAMD21_DOUBLE_TAP_ADDR;
*reset_addr = (uint32_t)SAMD21_DOUBLE_TAP_MAGIC_NUMBER;

usb_board_reset_in_application();
}
3 changes: 3 additions & 0 deletions boards/common/sodaq/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.dep
1 change: 1 addition & 0 deletions boards/common/sodaq/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ FEATURES_PROVIDED += periph_usbdev

# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += bootloader_arduino
7 changes: 2 additions & 5 deletions boards/common/sodaq/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# Add board common includes
INCLUDES += -I$(RIOTBOARD)/common/sodaq/include

# setup the flash tool used
# we use BOSSA to flash this board since there's an Arduino bootloader
# preflashed on it. ROM_OFFSET skips the space taken by such bootloader.
ROM_OFFSET ?= 0x2000
include $(RIOTMAKE)/tools/bossa.inc.mk
# Include all definitions for flashing with bossa over USB
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.include
3 changes: 3 additions & 0 deletions boards/feather-m0/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.dep
3 changes: 3 additions & 0 deletions boards/feather-m0/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += bootloader_arduino
10 changes: 2 additions & 8 deletions boards/feather-m0/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ ifeq ($(PROGRAMMER),jlink)
# in case J-Link is attached to SWD pins, use a plain CPU memory model
JLINK_DEVICE = atsamd21
include $(RIOTMAKE)/tools/jlink.inc.mk
else
# by default, we use BOSSA to flash this board to take into account the
# pre-flashed Arduino bootloader. ROM_OFFSET skips the space taken by
# such bootloader.
ROM_OFFSET ?= 0x2000
include $(RIOTMAKE)/tools/bossa.inc.mk
endif

# setup the boards dependencies
include $(RIOTBOARD)/feather-m0/Makefile.dep
# Include all definitions for flashing with bossa over USB
include $(RIOTBOARD)/common/samd21-arduino-bootloader/Makefile.include
20 changes: 12 additions & 8 deletions boards/feather-m0/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,22 @@ printf("Bat: %dV\n", vbat);

### Flash the board

1. Put the board in bootloader mode by double tapping the reset button.<br/>
When the board is in bootloader mode, the user led (red) oscillates smoothly.


2. Use `BOARD=feather-m0` with the `make` command.<br/>
Example with `hello-world` application:
Use `BOARD=feather-m0` with the `make` command.<br/>
Example with `hello-world` application:
```
make BOARD=feather-m0 -C examples/hello-world flash
```

@note If the application crashes, automatic reflashing via USB, as explained
above won't be possible. In this case, the board must be set in
bootloader mode by double tapping the reset button before running the
flash command.

### Accessing STDIO via UART

To access the STDIO of RIOT, a FTDI to USB converted needs to be plugged to
the RX/TX pins on the board.
STDIO of RIOT is directly available over the USB port.

The `TERM_DELAY` environment variable can be used to add a delay (in second)
before opening the serial terminal. The default value is 2s which should be
enough in most of the situation.
*/
21 changes: 15 additions & 6 deletions boards/sodaq-autonomo/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,25 @@ Besides the SAMD21 the board has the following features:

## Flashing the device

1. Put the board in bootloader mode by double tapping the reset button.<br/>
When the board is in bootloader mode, the user led (green) oscillates
smoothly.

2. Use `BOARD=sodaq-autonomo` with the `make` command.<br/>
Example with `hello-world` application:
Use `BOARD=sodaq-autonomo` with the `make` command.<br/>
Example with `hello-world` application:
```
make BOARD=sodaq-autonomo -C examples/hello-world flash
```

@note If the application crashes, automatic reflashing via USB, as explained
above won't be possible. In this case, the board must be set in
bootloader mode by double tapping the reset button before running the
flash command.

## Accessing STDIO via UART

STDIO of RIOT is directly available over the USB port.

The `TERM_DELAY` environment variable can be used to add a delay (in second)
before opening the serial terminal. The default value is 2s which should be
enough in most of the situation.

## Supported Toolchains

To build software for the autonomo board we strongly recommend the usage of
Expand Down
20 changes: 11 additions & 9 deletions boards/sodaq-explorer/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ General information about this board can be found on the

### Flash the board

1. Put the board in bootloader mode by double tapping the reset button.<br/>
When the board is in bootloader mode, the user led (blue) oscillates
smoothly.


2. Use `BOARD=sodaq-explorer` with the `make` command.<br/>
Example with `hello-world` application:
Use `BOARD=sodaq-explorer` with the `make` command.<br/>
Example with `hello-world` application:
```
make BOARD=sodaq-explorer -C examples/hello-world flash
```

@note If the application crashes, automatic reflashing via USB, as explained
above won't be possible. In this case, the board must be set in
bootloader mode by double tapping the reset button before running the
flash command.

### Accessing STDIO via UART

To access the STDIO of RIOT, a FTDI to USB converter needs to be plugged to
the RX/TX pins on the board.
STDIO of RIOT is directly available over the USB port.

The `TERM_DELAY` environment variable can be used to add a delay (in second)
before opening the serial terminal. The default value is 2s which should be
enough in most of the situation.
*/
Loading