diff --git a/CMakeLists.txt b/CMakeLists.txt index 53d5f323a..a91368267 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,11 @@ if (CONFIG_ARDUINO_API) elseif (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/variants/${NORMALIZED_BOARD_TARGET}) set(variant_dir variants/${NORMALIZED_BOARD_TARGET}) else() - message(FATAL_ERROR "Variant dir not found: variants/${BOARD}, variants/${NORMALIZED_BOARD_TARGET}") + message(WARNING + "Variant dir not found: variants/${BOARD}, variants/${NORMALIZED_BOARD_TARGET}\n" + "Your board is currently not supported. To use it you must create a DTS overlay." + ) + set(variant_dir variants/default) endif() add_subdirectory(cores) diff --git a/documentation/variants.md b/documentation/variants.md index 300c6a17a..5f985280d 100644 --- a/documentation/variants.md +++ b/documentation/variants.md @@ -38,6 +38,8 @@ variants/ │   ├── variant.h ``` +It is possible to apply the overlay outside of the `variants` folder. In that case `cmake` will show a warning and a default empty `variant.h` file will be used. The `zephyr,user` section will still need to be defined somewhere in your project, as described in the [Guide to Writing Overlays section](#guide-to-writing-overlays). + ## Guide to Writing Overlays ### DeviceTree Overlay files for Arduino boards diff --git a/variants/default/variant.h b/variants/default/variant.h new file mode 100644 index 000000000..c114d1bdd --- /dev/null +++ b/variants/default/variant.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Michal Gagos + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once \ No newline at end of file