From 7574ff040e5d8fc2c7cbc8c78ac05a14006760b4 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
Date: Mon, 25 Jul 2022 16:47:34 +0200
Subject: [PATCH] zephyr-openthread-rcp: refuse to build with ACM0 console
 enabled

The OpenThread border router on linux uses the USB console on the
antenna running zephyr. The ACM0 patch gets in the way and disables the
OpenThread interface. Error out if the user tries to have this option
enabled and build the antenna firmware.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
---
 .../recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb
index 6d3f860..0e17f4b 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb
@@ -8,3 +8,9 @@ EXTRA_OECMAKE += "-DCONF_FILE="prj.conf overlay-rcp.conf overlay-usb-nrf-br.conf
 # towards the boards (e.g. flash layout and ieee802154 radio) so we need to
 # limit to known working machines here.
 COMPATIBLE_MACHINE = "(arduino-nano-33-ble)"
+
+python __anonymous() {
+    has_acm0 = d.getVar("ONIRO_ENABLE_ACM0")
+    if has_acm0 and has_acm0 != "0":
+        raise bb.parse.SkipRecipe("OpenThread coprocessor cannot work with the ACM0 console enabled")
+}
-- 
GitLab