You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- It is most recommended that if you have a highly custom board that even zephyr-RTOS doesn't support yet then you should add support for it first there.
5
-
- You need to satisfy all requirements mentioned in the project's README.
3
+
- Boards already supported by Zephyr can be added to the variants folder as outlined in this documentation.
4
+
- Custom boards can first by added by following the [official Zephyr porting guide](https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html).
5
+
Once completed, continue here by adding a variant for your custom board.
6
+
7
+
## Suppored Boards/variants
8
+
9
+
-[X] Arduino Nano ble sense 33
10
+
-[X] Arduino Nano ble 33
11
+
-[X] Arduino Nano 33 iot
12
+
13
+
## Planned Support: (TODO)
14
+
-[ ] Particle Xenon
15
+
-[ ] Arduino mkrzero
16
+
-[ ] TI-CC3220SF LaunchXL
17
+
-[ ] nrf52840dk_nrf52840
18
+
19
+
## How to add board variants
20
+
21
+
This module uses the board name (supplied at build time by the `-b
22
+
arduino_nano_33_ble` flag) to correctly map Arduino pin names/numbers to the
23
+
target board. To add board support:
24
+
25
+
1. This project is structured in a way so as to isolate the variants from the core API. Thus, whenever a new board
26
+
needs to be added it needs to be done in the `variants/` folder.
27
+
Add a folder inside of the variants folder that matches the name of your board.
28
+
2. Add an overlay file and a pinmap header file that match the name of the board.
29
+
3. Add your new headerfile to an `#ifdef` statement in the variants.h file.
30
+
31
+
An example of this structure is shown below.
6
32
7
-
**General Instructions:** <br>
8
-
- The project is structures in a way so as to isolate the variants from the core API. Thus, whenever a new board needs to be added it needs to be done in the `variants/` folder.
9
-
- The structure of the variants folder with the help of an example is as follows:
10
33
```tree
11
34
variants/
12
35
├── arduino_nano_33_ble
@@ -22,13 +45,79 @@ variants/
22
45
- `variants.h` contains the necessary `#includes` inorder to tell the source code about your board's pinmap.
23
46
- The `<BOARD_NAME>` folder is where the overlay and pinmap file resides. Inorder to understand how to write DT overlays, lookup `Documentation/overlays.md`. To understand the `<boardname_pinmap.h> file, go through the existing `variants/ARDUINO_NANO33BLE/arduino_nano_ble_sense_pinmap.h` which shows how to use the overlay nodes inside our C programs using zephyr macros like `GPIO_DT_SPEC_GET`. The zephyr-project documentation on this is pretty extensive as well and worth reading.
24
47
25
-
## Suppored Boards/variants
48
+
## Guide to Writing Overlays
26
49
27
-
-[X] Arduino Nano ble sense 33
28
-
-[X] Arduino Nano ble 33
29
-
-[X] Arduino Nano 33 iot
50
+
### DeviceTree Overlay files for Arduino boards
30
51
31
-
## Planned Support: (TODO)
32
-
-[ ] Particle Xenon
33
-
-[ ] Arduino mkrzero
34
-
-[ ] TI-CC3220SF LaunchXL
52
+
This module requires that your Arduino header pins be mapped in the DeviceTree
53
+
to a `zephyr,user` node using the `d0_gpios` format for each pin. Follow the
54
+
examples in the variants directory to create an overlay file and a header file
55
+
for your board.
56
+
57
+
### Overlays using previously-defined Arduino headers
58
+
59
+
When an Arduino header exists in a board's in-tree DTS file it can easily be
60
+
used to create the necessary overlay file. Assign the relevant mapping using the
61
+
Arduino header label (usually either `&arduino_header` or `&arduino_nano_header`
62
+
and the `gpio_map` number. The second number is used to add GPIO flags and may
63
+
safely be left as zero.
64
+
65
+
For example, creating an overlay file for the Nordic nRF52840 Development Kit
66
+
uses [the Arduino header definitions](https://github.com/zephyrproject-rtos/zephyr/blob/6f8ee2cdf7dd4d746de58909204ea0ce156d5bb4/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts#L74-L101), beginning with the first digital pin:
0 commit comments