Skip to content

Commit

Permalink
doc: update Makefile.include instructions
Browse files Browse the repository at this point in the history
Specify the programmer using the PROGRAMMER variable, don't include programmer specific makefile and serial makefile
  • Loading branch information
aabadie committed Dec 2, 2020
1 parent 646e665 commit b31357e
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions doc/doxygen/src/porting-boards.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,31 @@ FEATURES_PROVIDED += periph_uart
### Makefile.include {#makefile-include}

This file contains BSP or toolchain configurations for the `BOARD`. It
should at least define the configuration needed for flashing (i.e. a
programmer) as well as the serial configuration (if one is available).
should at least define the configuration needed for flashing (i.e. specify a
default programmer) as well as the serial configuration (if one is available).
The default serial port configuration is provided by
`makefiles/tools/serial.inc.mk` and define the following values for the serial
port (depends on the host OS):

e.g.:
```
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
```

So if the board is also using this, there's no need to redefine these variables
in the board configuration.

For example a board that is using a custom serial port (via an USB to serial
adapter) and that is flashed using openocd by default would have the following
content in its `Makefile.include`:

```mk
# Define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))

# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
PROGRAMMER ?= openocd
```

## doc.txt {#board-doc}
Expand Down

0 comments on commit b31357e

Please sign in to comment.