How to set more than one devicetree overlay

Hi,

I am new to devicetree overlays. I have read that it is possible to use multiple devicetree overlays, but I am stuck on how to accomplish this. I have read from your documentation that you have to change the CMake variable EXTRA_DTC_OVERLAY_FILE. I have no idea where to change this or how to change it, though.

Regards,

Nathan

Parents
  • Hi,

    You can either provide it as an argument when building or you can set it in your project's CMakeLists.txt.

    When providing it as an argument when building you need to add -DEXTRA_DTC_OVERLAY_FILE="extra_dts.overlay". When building on command line you add it to the build command, for example:

    west build -b nrf9160dk_nrf9160_ns -- -DEXTRA_DTC_OVERLAY_FILE="extra_dts.overlay"

    In the VS Code extension you can add it under "Extra CMake arguments":

    If you instead want to set it in CMakeLists.txt you can use the set command:

    set(EXTRA_DTC_OVERLAY_FILE "extra_dts.overlay")

    Best regards,
    Marte

Reply
  • Hi,

    You can either provide it as an argument when building or you can set it in your project's CMakeLists.txt.

    When providing it as an argument when building you need to add -DEXTRA_DTC_OVERLAY_FILE="extra_dts.overlay". When building on command line you add it to the build command, for example:

    west build -b nrf9160dk_nrf9160_ns -- -DEXTRA_DTC_OVERLAY_FILE="extra_dts.overlay"

    In the VS Code extension you can add it under "Extra CMake arguments":

    If you instead want to set it in CMakeLists.txt you can use the set command:

    set(EXTRA_DTC_OVERLAY_FILE "extra_dts.overlay")

    Best regards,
    Marte

Children
Related