1.. _board_porting_guide: 2 3Board Porting Guide 4################### 5 6To add Zephyr support for a new :term:`board`, you at least need a *board 7directory* with various files in it. Files in the board directory inherit 8support for at least one SoC and all of its features. Therefore, Zephyr must 9support your :term:`SoC` as well. 10 11Boards, SoCs, etc. 12****************** 13 14Zephyr's hardware support hierarchy has these layers, from most to least 15specific: 16 17- Board: a particular CPU instance and its peripherals in a concrete hardware 18 specification 19- SoC: the exact system on a chip the board's CPU is part of 20- SoC series: a smaller group of tightly related SoCs 21- SoC family: a wider group of SoCs with similar characteristics 22- CPU core: a particular CPU in an architecture 23- Architecture: an instruction set architecture 24 25You can visualize the hierarchy like this: 26 27.. figure:: board/hierarchy.png 28 :width: 500px 29 :align: center 30 :alt: Configuration Hierarchy 31 32 Configuration Hierarchy 33 34Here are some examples. Notice how the SoC series and family levels are 35not always used. 36 37.. list-table:: 38 :header-rows: 1 39 40 * - Board 41 - SoC 42 - SoC series 43 - SoC family 44 - CPU core 45 - Architecture 46 * - :ref:`nrf52dk_nrf52832 <nrf52dk_nrf52832>` 47 - nRF52832 48 - nRF52 49 - Nordic nRF5 50 - Arm Cortex-M4 51 - Arm 52 * - :ref:`frdm_k64f <frdm_k64f>` 53 - MK64F12 54 - Kinetis K6x 55 - NXP Kinetis 56 - Arm Cortex-M4 57 - Arm 58 * - :ref:`stm32h747i_disco <stm32h747i_disco_board>` 59 - STM32H747XI 60 - STM32H7 61 - STMicro STM32 62 - Arm Cortex-M7 63 - Arm 64 * - :ref:`rv32m1_vega_ri5cy <rv32m1_vega>` 65 - RV32M1 66 - (Not used) 67 - (Not used) 68 - RI5CY 69 - RISC-V 70 71Make sure your SoC is supported 72******************************* 73 74Start by making sure your SoC is supported by Zephyr. If it is, it's time to 75:ref:`create-your-board-directory`. If you don't know, try: 76 77- checking :ref:`boards` for names that look relevant, and reading individual 78 board documentation to find out for sure. 79- asking your SoC vendor 80 81If you need to add SoC, CPU core, or even architecture support, this is the 82wrong page, but here is some general advice. 83 84Architecture 85============ 86 87See :ref:`architecture_porting_guide`. 88 89CPU Core 90======== 91 92CPU core support files go in ``core`` subdirectories under :zephyr_file:`arch`, 93e.g. :zephyr_file:`arch/x86/core`. 94 95See :ref:`gs_toolchain` for information about toolchains (compiler, linker, 96etc.) supported by Zephyr. If you need to support a new toolchain, 97:ref:`build_overview` is a good place to start learning about the build system. 98Please reach out to the community if you are looking for advice or want to 99collaborate on toolchain support. 100 101SoC 102=== 103 104Zephyr SoC support files are in architecture-specific subdirectories of 105:zephyr_file:`soc`. They are generally grouped by SoC family. 106 107When adding a new SoC family or series for a vendor that already has SoC 108support within Zephyr, please try to extract common functionality into shared 109files to avoid duplication. If there is no support for your vendor yet, you can 110add it in a new directory ``zephyr/soc/<YOUR-ARCH>/<YOUR-SOC>``; please use 111self-explanatory directory names. 112 113.. _create-your-board-directory: 114 115Create your board directory 116*************************** 117 118Once you've found an existing board that uses your SoC, you can usually start 119by copy/pasting its board directory and changing its contents for your 120hardware. 121 122You need to give your board a unique name. Run ``west boards`` for a list of 123names that are already taken, and pick something new. Let's say your board is 124called ``plank`` (please don't actually use that name). 125 126Start by creating the board directory ``zephyr/boards/<ARCH>/plank``, where 127``<ARCH>`` is your SoC's architecture subdirectory. (You don't have to put your 128board directory in the zephyr repository, but it's the easiest way to get 129started. See :ref:`custom_board_definition` for documentation on moving your 130board directory to a separate repository once it's working.) 131 132Your board directory should look like this: 133 134.. code-block:: none 135 136 boards/<ARCH>/plank 137 ├── board.cmake 138 ├── CMakeLists.txt 139 ├── doc 140 │ ├── plank.png 141 │ └── index.rst 142 ├── Kconfig.board 143 ├── Kconfig.defconfig 144 ├── plank_defconfig 145 ├── plank.dts 146 └── plank.yaml 147 148Replace ``plank`` with your board's name, of course. 149 150The mandatory files are: 151 152#. :file:`plank.dts`: a hardware description in :ref:`devicetree 153 <dt-guide>` format. This declares your SoC, connectors, and any 154 other hardware components such as LEDs, buttons, sensors, or communication 155 peripherals (USB, BLE controller, etc). 156 157#. :file:`Kconfig.board`, :file:`Kconfig.defconfig`, :file:`plank_defconfig`: 158 software configuration in :ref:`kconfig` formats. This provides default 159 settings for software features and peripheral drivers. 160 161The optional files are: 162 163- :file:`board.cmake`: used for :ref:`flash-and-debug-support` 164- :file:`CMakeLists.txt`: if you need to add additional source files to 165 your build. 166 167 One common use for this file is to add a :file:`pinmux.c` file in your board 168 directory to the build, which configures pin controllers at boot time. In 169 that case, :file:`CMakeLists.txt` usually looks like this: 170 171 .. code-block:: cmake 172 173 if(CONFIG_PINMUX) 174 zephyr_library() 175 zephyr_library_sources(pinmux.c) 176 endif() 177 178- :file:`doc/index.rst`, :file:`doc/plank.png`: documentation for and a picture 179 of your board. You only need this if you're :ref:`contributing-your-board` to 180 Zephyr. 181- :file:`plank.yaml`: a YAML file with miscellaneous metadata used by the 182 :ref:`twister_script`. 183 184.. _default_board_configuration: 185 186Write your devicetree 187********************* 188 189The devicetree file :file:`boards/<ARCH>/plank/plank.dts` describes your board 190hardware in the Devicetree Source (DTS) format (as usual, change ``plank`` to 191your board's name). If you're new to devicetree, see :ref:`devicetree-intro`. 192 193In general, :file:`plank.dts` should look like this: 194 195.. code-block:: devicetree 196 197 /dts-v1/; 198 #include <your_soc_vendor/your_soc.dtsi> 199 200 / { 201 model = "A human readable name"; 202 compatible = "yourcompany,plank"; 203 204 chosen { 205 zephyr,console = &your_uart_console; 206 zephyr,sram = &your_memory_node; 207 /* other chosen settings for your hardware */ 208 }; 209 210 /* 211 * Your board-specific hardware: buttons, LEDs, sensors, etc. 212 */ 213 214 leds { 215 compatible = "gpio-leds"; 216 led0: led_0 { 217 gpios = < /* GPIO your LED is hooked up to */ >; 218 label = "LED 0"; 219 }; 220 /* ... other LEDs ... */ 221 }; 222 223 buttons { 224 compatible = "gpio-keys"; 225 /* ... your button definitions ... */ 226 }; 227 228 /* These aliases are provided for compatibility with samples */ 229 aliases { 230 led0 = &led0; /* now you support the blinky sample! */ 231 /* other aliases go here */ 232 }; 233 }; 234 235 &some_peripheral_you_want_to_enable { /* like a GPIO or SPI controller */ 236 status = "okay"; 237 }; 238 239 &another_peripheral_you_want { 240 status = "okay"; 241 }; 242 243If you're in a hurry, simple hardware can usually be supported by copy/paste 244followed by trial and error. If you want to understand details, you will need 245to read the rest of the devicetree documentation and the devicetree 246specification. 247 248.. _dt_k6x_example: 249 250Example: FRDM-K64F and Hexiwear K64 251=================================== 252 253.. Give the filenames instead of the full paths below, as it's easier to read. 254 The cramped 'foo.dts<path>' style avoids extra spaces before commas. 255 256This section contains concrete examples related to writing your board's 257devicetree. 258 259The FRDM-K64F and Hexiwear K64 board devicetrees are defined in 260:zephyr_file:`frdm_k64fs.dts <boards/arm/frdm_k64f/frdm_k64f.dts>` and 261:zephyr_file:`hexiwear_k64.dts <boards/arm/hexiwear_k64/hexiwear_k64.dts>` 262respectively. Both boards have NXP SoCs from the same Kinetis SoC family, the 263K6X. 264 265Common devicetree definitions for K6X are stored in :zephyr_file:`nxp_k6x.dtsi 266<dts/arm/nxp/nxp_k6x.dtsi>`, which is included by both board :file:`.dts` 267files. :zephyr_file:`nxp_k6x.dtsi<dts/arm/nxp/nxp_k6x.dtsi>` in turn includes 268:zephyr_file:`armv7-m.dtsi<dts/arm/armv7-m.dtsi>`, which has common definitions 269for Arm v7-M cores. 270 271Since :zephyr_file:`nxp_k6x.dtsi<dts/arm/nxp/nxp_k6x.dtsi>` is meant to be 272generic across K6X-based boards, it leaves many devices disabled by default 273using ``status`` properties. For example, there is a CAN controller defined as 274follows (with unimportant parts skipped): 275 276.. code-block:: devicetree 277 278 can0: can@40024000 { 279 ... 280 status = "disabled"; 281 ... 282 }; 283 284It is up to the board :file:`.dts` or application overlay files to enable these 285devices as desired, by setting ``status = "okay"``. The board :file:`.dts` 286files are also responsible for any board-specific configuration of the device, 287such as adding nodes for on-board sensors, LEDs, buttons, etc. 288 289For example, FRDM-K64 (but not Hexiwear K64) :file:`.dts` enables the CAN 290controller and sets the bus speed: 291 292.. code-block:: devicetree 293 294 &can0 { 295 status = "okay"; 296 bus-speed = <125000>; 297 }; 298 299The ``&can0 { ... };`` syntax adds/overrides properties on the node with label 300``can0``, i.e. the ``can@4002400`` node defined in the :file:`.dtsi` file. 301 302Other examples of board-specific customization is pointing properties in 303``aliases`` and ``chosen`` to the right nodes (see :ref:`dt-alias-chosen`), and 304making GPIO/pinmux assignments. 305 306Write Kconfig files 307******************* 308 309Zephyr uses the Kconfig language to configure software features. Your board 310needs to provide some Kconfig settings before you can compile a Zephyr 311application for it. 312 313Setting Kconfig configuration values is documented in detail in 314:ref:`setting_configuration_values`. 315 316There are three mandatory Kconfig files in the board directory for a board 317named ``plank``: 318 319.. code-block:: none 320 321 boards/<ARCH>/plank 322 ├── Kconfig.board 323 ├── Kconfig.defconfig 324 └── plank_defconfig 325 326:file:`Kconfig.board` 327 Included by :zephyr_file:`boards/Kconfig` to include your board 328 in the list of options. 329 330 This should at least contain a definition for a ``BOARD_PLANK`` option, 331 which looks something like this: 332 333 .. code-block:: none 334 335 config BOARD_PLANK 336 bool "Plank board" 337 depends on SOC_SERIES_YOUR_SOC_SERIES_HERE 338 select SOC_PART_NUMBER_ABCDEFGH 339 340:file:`Kconfig.defconfig` 341 Board-specific default values for Kconfig options. 342 343 The entire file should be inside an ``if BOARD_PLANK`` / ``endif`` pair of 344 lines, like this: 345 346 .. code-block:: none 347 348 if BOARD_PLANK 349 350 # Always set CONFIG_BOARD here. This isn't meant to be customized, 351 # but is set as a "default" due to Kconfig language restrictions. 352 config BOARD 353 default "plank" 354 355 # Other options you want enabled by default go next. Examples: 356 357 config FOO 358 default y 359 360 if NETWORKING 361 config SOC_ETHERNET_DRIVER 362 default y 363 endif # NETWORKING 364 365 endif # BOARD_PLANK 366 367:file:`plank_defconfig` 368 A Kconfig fragment that is merged as-is into the final build directory 369 :file:`.config` whenever an application is compiled for your board. 370 371 You should at least select your board's SOC and do any mandatory settings for 372 your system clock, console, etc. The results are architecture-specific, but 373 typically look something like this: 374 375 .. code-block:: none 376 377 CONFIG_SOC_${VENDOR_XYZ3000}=y /* select your SoC */ 378 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000 /* set up your clock, etc */ 379 CONFIG_SERIAL=y 380 381:file:`plank_x_y_z.conf` 382 A Kconfig fragment that is merged as-is into the final build directory 383 :file:`.config` whenever an application is compiled for your board revision 384 ``x.y.z``. 385 386Build, test, and fix 387******************** 388 389Now it's time to build and test the application(s) you want to run on your 390board until you're satisfied. 391 392For example: 393 394.. code-block:: console 395 396 west build -b plank samples/hello_world 397 west flash 398 399For ``west flash`` to work, see :ref:`flash-and-debug-support` below. You can 400also just flash :file:`build/zephyr/zephyr.elf`, :file:`zephyr.hex`, or 401:file:`zephyr.bin` with any other tools you prefer. 402 403.. _porting-general-recommendations: 404 405General recommendations 406*********************** 407 408For consistency and to make it easier for users to build generic applications 409that are not board specific for your board, please follow these guidelines 410while porting. 411 412- Unless explicitly recommended otherwise by this section, leave peripherals 413 and their drivers disabled by default. 414 415- Configure and enable a system clock, along with a tick source. 416 417- Provide pin and driver configuration that matches the board's valuable 418 components such as sensors, buttons or LEDs, and communication interfaces 419 such as USB, Ethernet connector, or Bluetooth/Wi-Fi chip. 420 421- If your board uses a well-known connector standard (like Arduino, Mikrobus, 422 Grove, or 96Boards connectors), add connector nodes to your DTS and configure 423 pin muxes accordingly. 424 425- Configure components that enable the use of these pins, such as 426 configuring an SPI instance to use the usual Arduino SPI pins. 427 428- If available, configure and enable a serial output for the console 429 using the ``zephyr,console`` chosen node in the devicetree. 430 431- If your board supports networking, configure a default interface. 432 433- Enable all GPIO ports connected to peripherals or expansion connectors. 434 435- If available, enable pinmux and interrupt controller drivers. 436 437- It is recommended to enable the MPU by default, if there is support for it 438 in hardware. For boards with limited memory resources it is acceptable to 439 disable it. When the MPU is enabled, it is recommended to also enable 440 hardware stack protection (CONFIG_HW_STACK_PROTECTION=y) and, thus, allow the 441 kernel to detect stack overflows when the system is running in privileged 442 mode. 443 444.. _flash-and-debug-support: 445 446Flash and debug support 447*********************** 448 449Zephyr supports :ref:`west-build-flash-debug` via west extension commands. 450 451To add ``west flash`` and ``west debug`` support for your board, you need to 452create a :file:`board.cmake` file in your board directory. This file's job is 453to configure a "runner" for your board. (There's nothing special you need to 454do to get ``west build`` support for your board.) 455 456"Runners" are Zephyr-specific Python classes that wrap :ref:`flash and debug 457host tools <flash-debug-host-tools>` and integrate with west and the zephyr build 458system to support ``west flash`` and related commands. Each runner supports 459flashing, debugging, or both. You need to configure the arguments to these 460Python scripts in your :file:`board.cmake` to support those commands like this 461example :file:`board.cmake`: 462 463.. code-block:: cmake 464 465 board_runner_args(jlink "--device=nrf52" "--speed=4000") 466 board_runner_args(pyocd "--target=nrf52" "--frequency=4000000") 467 468 include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) 469 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) 470 include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) 471 472This example configures the ``nrfjprog``, ``jlink``, and ``pyocd`` runners. 473 474.. warning:: 475 476 Runners usually have names which match the tools they wrap, so the ``jlink`` 477 runner wraps Segger's J-Link tools, and so on. But the runner command line 478 options like ``--speed`` etc. are specific to the Python scripts. 479 480For more details: 481 482- Run ``west flash --context`` to see a list of available runners which support 483 flashing, and ``west flash --context -r <RUNNER>`` to view the specific options 484 available for an individual runner. 485- Run ``west debug --context`` and ``west debug --context <RUNNER>`` to get 486 the same output for runners which support debugging. 487- Run ``west flash --help`` and ``west debug --help`` for top-level options 488 for flashing and debugging. 489- See :ref:`west-runner` for Python APIs. 490- Look for :file:`board.cmake` files for other boards similar to your own for 491 more examples. 492 493To see what a ``west flash`` or ``west debug`` command is doing exactly, run it 494in verbose mode: 495 496.. code-block:: sh 497 498 west --verbose flash 499 west --verbose debug 500 501Verbose mode prints any host tool commands the runner uses. 502 503The order of the ``include()`` calls in your :file:`board.cmake` matters. The 504first ``include`` sets the default runner if it's not already set. For example, 505including ``nrfjprog.board.cmake`` first means that ``nrjfprog`` is the default 506flash runner for this board. Since ``nrfjprog`` does not support debugging, 507``jlink`` is the default debug runner. 508 509.. _porting_board_revisions: 510 511Multiple board revisions 512************************ 513 514See :ref:`application_board_version` for basics on this feature from the user 515perspective. 516 517To create a new board revision for the ``plank`` board, create these additional 518files in the board folder: 519 520.. code-block:: none 521 522 boards/<ARCH>/plank 523 ├── plank_<revision>.conf # optional 524 ├── plank_<revision>.overlay # optional 525 └── revision.cmake 526 527When the user builds for board ``plank@<revision>``: 528 529- The optional Kconfig settings specified in the file 530 :file:`plank_<revision>.conf` will be merged into the board's default Kconfig 531 configuration. 532 533- The optional devicetree overlay :file:`plank_<revision>.overlay` will be added 534 to the common :file:`plank.dts` devicetree file 535 536- The :file:`revision.cmake` file controls how the Zephyr build system matches 537 the ``<board>@<revision>`` string specified by the user when building an 538 application for the board. 539 540Currently, ``<revision>`` can be either a numeric ``MAJOR.MINOR.PATCH`` style 541revision like ``1.5.0``, or single letter like ``A``, ``B``, etc. Zephyr 542provides a CMake board extension function, ``board_check_revision()``, to make 543it easy to match either style from :file:`revision.cmake`. 544 545Valid board revisions may be specified as arguments to the 546``board_check_revision()`` function, like: 547 548.. code-block:: cmake 549 550 board_check_revision(FORMAT MAJOR.MINOR.PATCH 551 VALID_REVISIONS 0.1.0 0.3.0 ... 552 ) 553 554.. note:: 555 ``VALID_REVISIONS`` can be omitted if all valid revisions have specific 556 Kconfig fragments, such as ``<board>_0_1_0.conf``, ``<board>_0_3_0.conf``. 557 This allows you to just place Kconfig revision fragments in the board 558 folder and not have to keep the corresponding ``VALID_REVISIONS`` in sync. 559 560The following sections describe how to support these styles of revision 561numbers. 562 563Numeric revisions 564================= 565 566Let's say you want to add support for revisions ``0.5.0``, ``1.0.0``, and 567``1.5.0`` of the ``plank`` board with both Kconfig fragments and devicetree 568overlays. Create :file:`revision.cmake` with 569``board_check_revision(FORMAT MAJOR.MINOR.PATCH)``, and create the following 570additional files in the board directory: 571 572.. code-block:: none 573 574 boards/<ARCH>/plank 575 ├── plank_0_5_0.conf 576 ├── plank_0_5_0.overlay 577 ├── plank_1_0_0.conf 578 ├── plank_1_0_0.overlay 579 ├── plank_1_5_0.conf 580 ├── plank_1_5_0.overlay 581 └── revision.cmake 582 583Notice how the board files have changed periods (".") in the revision number to 584underscores ("_"). 585 586Fuzzy numeric revision matching 587=============================== 588 589To support "fuzzy" ``MAJOR.MINOR.PATCH`` revision matching for the ``plank`` 590board, use the following code in :file:`revision.cmake`: 591 592.. code-block:: cmake 593 594 board_check_revision(FORMAT MAJOR.MINOR.PATCH) 595 596If the user selects a revision between those available, the closest revision 597number that is not larger than the user's choice is used. For example, if the 598user builds for ``plank@0.7.0``, the build system will target revision 599``0.5.0``. 600 601The build system will print this at CMake configuration time: 602 603.. code-block:: console 604 605 -- Board: plank, Revision: 0.7.0 (Active: 0.5.0) 606 607This allows you to only create revision configuration files for board revision 608numbers that introduce incompatible changes. 609 610Any revision less than the minimum defined will be treated as an error. 611 612You may use ``0.0.0`` as a minimum revision to build for by creating the file 613:file:`plank_0_0_0.conf` in the board directory. This will be used for any 614revision lower than ``0.5.0``, for example if the user builds for 615``plank@0.1.0``. 616 617Exact numeric revision matching 618=============================== 619 620Alternatively, the ``EXACT`` keyword can be given to ``board_check_revision()`` 621in :file:`revision.cmake` to allow exact matches only, like this: 622 623.. code-block:: cmake 624 625 board_check_revision(FORMAT MAJOR.MINOR.PATCH EXACT) 626 627With this :file:`revision.cmake`, building for ``plank@0.7.0`` in the above 628example will result in the following error message: 629 630.. code-block:: console 631 632 Board revision `0.7.0` not found. Please specify a valid board revision. 633 634Letter revision matching 635======================== 636 637Let's say instead that you need to support revisions ``A``, ``B``, and ``C`` of 638the ``plank`` board. Create the following additional files in the board 639directory: 640 641.. code-block:: none 642 643 boards/<ARCH>/plank 644 ├── plank_A.conf 645 ├── plank_A.overlay 646 ├── plank_B.conf 647 ├── plank_B.overlay 648 ├── plank_C.conf 649 ├── plank_C.overlay 650 └── revision.cmake 651 652And add the following to :file:`revision.cmake`: 653 654.. code-block:: cmake 655 656 board_check_revision(FORMAT LETTER) 657 658board_check_revision() details 659============================== 660 661.. code-block:: cmake 662 663 board_check_revision(FORMAT <LETTER | MAJOR.MINOR.PATCH> 664 [EXACT] 665 [DEFAULT_REVISION <revision>] 666 [HIGHEST_REVISION <revision>] 667 [VALID_REVISIONS <revision> [<revision> ...]] 668 ) 669 670This function supports the following arguments: 671 672* ``FORMAT LETTER``: matches single letter revisions from ``A`` to ``Z`` only 673* ``FORMAT MAJOR.MINOR.PATCH``: matches exactly three digits. The command line 674 allows for loose typing, that is ``-DBOARD=<board>@1`` and 675 ``-DBOARD=<board>@1.0`` will be handled as ``-DBOARD=<board>@1.0.0``. 676 Kconfig fragment and devicetree overlay files must use full numbering to avoid 677 ambiguity, so only :file:`<board>_1_0_0.conf` and 678 :file:`<board>_1_0_0.overlay` are allowed. 679 680* ``EXACT``: if given, the revision is required to be an exact match. 681 Otherwise, the closest matching revision not greater than the user's choice 682 will be selected. 683 684* ``DEFAULT_REVISION <revision>``: if given, ``<revision>`` is the default 685 revision to use when user has not selected a revision number. If not given, 686 the build system prints an error when the user does not specify a board 687 revision. 688 689* ``HIGHEST_REVISION``: if given, specifies the highest valid revision for a 690 board. This can be used to ensure that a newer board cannot be used with an 691 older Zephyr. For example, if the current board directory supports revisions 692 0.x.0-0.99.99 and 1.0.0-1.99.99, and it is expected that the implementation 693 will not work with board revision 2.0.0, then giving ``HIGHEST_REVISION 694 1.99.99`` causes an error if the user builds using ``<board>@2.0.0``. 695 696* ``VALID_REVISIONS``: if given, specifies a list of revisions that are valid 697 for this board. If this argument is not given, then each Kconfig fragment of 698 the form ``<board>_<revision>.conf`` in the board folder will be used as a 699 valid revision for the board. 700 701.. _porting_custom_board_revisions: 702 703Custom revision.cmake files 704*************************** 705 706Some boards may not use board revisions supported by 707``board_check_revision()``. To support revisions of any type, the file 708:file:`revision.cmake` can implement custom revision matching without calling 709``board_check_revision()``. 710 711To signal to the build system that it should use a different revision than the 712one specified by the user, :file:`revision.cmake` can set the variable 713``ACTIVE_BOARD_REVISION`` to the revision to use instead. The corresponding 714Kconfig files and devicetree overlays must be named 715:file:`<board>_<ACTIVE_BOARD_REVISION>.conf` and 716:file:`<board>_<ACTIVE_BOARD_REVISION>.overlay`. 717 718For example, if the user builds for ``plank@zero``, :file:`revision.cmake` can 719set ``ACTIVE_BOARD_REVISION`` to ``one`` to use the files 720:file:`plank_one.conf` and :file:`plank_one.overlay`. 721 722.. _contributing-your-board: 723 724Contributing your board 725*********************** 726 727If you want to contribute your board to Zephyr, first -- thanks! 728 729There are some extra things you'll need to do: 730 731#. Make sure you've followed all the :ref:`porting-general-recommendations`. 732 They are requirements for boards included with Zephyr. 733 734#. Add documentation for your board using the template file 735 :zephyr_file:`doc/templates/board.tmpl`. See :ref:`zephyr_doc` for 736 information on how to build your documentation before submitting 737 your pull request. 738 739#. Prepare a pull request adding your board which follows the 740 :ref:`contribute_guidelines`. 741