From 76dbac2d41b7966bcadf019126e6f9d70f53424d Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Wed, 25 Dec 2024 13:03:49 +0000 Subject: [PATCH] app: boards: add support for the candlelightFD board Add support for the candlelightFD board from Linux Automation. The board optionally supports a second CAN channel, but only provides two LEDs (RX/TX) in total. To work around this limitation, the "dual" configuration uses the RX LED for channel 0 state/activity, and the TX LED for channel 1 state/activity. Signed-off-by: Henrik Brix Andersen --- app/boards/candlelightfd_stm32g0b1xx.overlay | 37 ++++++++++++++++ .../candlelightfd_stm32g0b1xx_dual.conf | 4 ++ .../candlelightfd_stm32g0b1xx_dual.overlay | 44 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 app/boards/candlelightfd_stm32g0b1xx.overlay create mode 100644 app/boards/candlelightfd_stm32g0b1xx_dual.conf create mode 100644 app/boards/candlelightfd_stm32g0b1xx_dual.overlay diff --git a/app/boards/candlelightfd_stm32g0b1xx.overlay b/app/boards/candlelightfd_stm32g0b1xx.overlay new file mode 100644 index 0000000..57330e6 --- /dev/null +++ b/app/boards/candlelightfd_stm32g0b1xx.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Henrik Brix Andersen + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counter2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan1>; + activity-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>, + <&gpioa 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&zephyr_udc0 { + gs_usb0: gs_usb0 { + compatible = "gs_usb"; + }; +}; + +&timers2 { + status = "okay"; + st,prescaler = <59>; + + counter2: counter2 { + compatible = "st,stm32-counter"; + status = "okay"; + }; +}; diff --git a/app/boards/candlelightfd_stm32g0b1xx_dual.conf b/app/boards/candlelightfd_stm32g0b1xx_dual.conf new file mode 100644 index 0000000..f5a4c01 --- /dev/null +++ b/app/boards/candlelightfd_stm32g0b1xx_dual.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2024 Henrik Brix Andersen +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_USB_DEVICE_GS_USB_MAX_CHANNELS=2 diff --git a/app/boards/candlelightfd_stm32g0b1xx_dual.overlay b/app/boards/candlelightfd_stm32g0b1xx_dual.overlay new file mode 100644 index 0000000..aef3193 --- /dev/null +++ b/app/boards/candlelightfd_stm32g0b1xx_dual.overlay @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Henrik Brix Andersen + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counter2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan1>; + /* Use RX LED for channel 0 state + activity */ + state-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>; + }; + + channel1 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan2>; + /* Use TX LED for channel 0 state + activity */ + state-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&zephyr_udc0 { + gs_usb0: gs_usb0 { + compatible = "gs_usb"; + }; +}; + +&timers2 { + status = "okay"; + st,prescaler = <59>; + + counter2: counter2 { + compatible = "st,stm32-counter"; + status = "okay"; + }; +};