Merge pull request #15544 from aabadie/pr/doc/board_porting_serial

doc: update board porting documentation page
This commit is contained in:
Alexandre Abadie 2020-12-02 13:27:07 +01:00 committed by GitHub
commit 53b1a2f36d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}