From d93f418915730735a470d18d4d66541a7ec06d1e Mon Sep 17 00:00:00 2001 From: Oleksii <35818127+AlekseyMamontov@users.noreply.github.com> Date: Sat, 27 Jun 2026 17:20:15 +0000 Subject: [PATCH] boards: add support for usbcan_iso, usbcanfd solo/dual,canbridge_g473 and boot animation Signed-off-by: Oleksii <35818127+AlekseyMamontov@users.noreply.github.com> --- app/boards/canbridge_g473_stm32g473xx.conf | 6 +++ app/boards/canbridge_g473_stm32g473xx.overlay | 39 +++++++++++++++++++ app/boards/usbcan_iso_stm32f072xb.conf | 7 ++++ app/boards/usbcan_iso_stm32f072xb.overlay | 31 +++++++++++++++ app/boards/usbcanfd_dual_stm32g473xx.conf | 6 +++ app/boards/usbcanfd_dual_stm32g473xx.overlay | 33 ++++++++++++++++ app/boards/usbcanfd_solo_stm32g431xx.conf | 6 +++ app/boards/usbcanfd_solo_stm32g431xx.overlay | 28 +++++++++++++ app/src/led.c | 2 +- 9 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 app/boards/canbridge_g473_stm32g473xx.conf create mode 100644 app/boards/canbridge_g473_stm32g473xx.overlay create mode 100644 app/boards/usbcan_iso_stm32f072xb.conf create mode 100644 app/boards/usbcan_iso_stm32f072xb.overlay create mode 100644 app/boards/usbcanfd_dual_stm32g473xx.conf create mode 100644 app/boards/usbcanfd_dual_stm32g473xx.overlay create mode 100644 app/boards/usbcanfd_solo_stm32g431xx.conf create mode 100644 app/boards/usbcanfd_solo_stm32g431xx.overlay diff --git a/app/boards/canbridge_g473_stm32g473xx.conf b/app/boards/canbridge_g473_stm32g473xx.conf new file mode 100644 index 0000000..86dd54c --- /dev/null +++ b/app/boards/canbridge_g473_stm32g473xx.conf @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CANNECTIVITY_USB_SELF_POWERED=n +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/app/boards/canbridge_g473_stm32g473xx.overlay b/app/boards/canbridge_g473_stm32g473xx.overlay new file mode 100644 index 0000000..5bb1ca6 --- /dev/null +++ b/app/boards/canbridge_g473_stm32g473xx.overlay @@ -0,0 +1,39 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "../app.overlay" + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counters2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan1>; + activity-leds = <&led_can1>; + }; + channel1 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan2>; + activity-leds = <&led_can2>; + }; + channel2 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan3>; + activity-leds = <&led_can3>; + }; + + }; +}; + +&timers2 { + st,prescaler = <159>; + counters2: counter { + status = "okay"; + }; +}; diff --git a/app/boards/usbcan_iso_stm32f072xb.conf b/app/boards/usbcan_iso_stm32f072xb.conf new file mode 100644 index 0000000..a113f88 --- /dev/null +++ b/app/boards/usbcan_iso_stm32f072xb.conf @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CANNECTIVITY_USB_SELF_POWERED=n +CONFIG_CAN_FD_MODE=n +CONFIG_CAN_STM32_BXCAN_MAX_STD_ID_FILTERS=1 +CONFIG_CAN_STM32_BXCAN_MAX_EXT_ID_FILTERS=1 diff --git a/app/boards/usbcan_iso_stm32f072xb.overlay b/app/boards/usbcan_iso_stm32f072xb.overlay new file mode 100644 index 0000000..b098c17 --- /dev/null +++ b/app/boards/usbcan_iso_stm32f072xb.overlay @@ -0,0 +1,31 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "../app.overlay" + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counter2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&can1>; + activity-leds = <&led_rx &led_tx>; + }; + }; +}; + +&timers2 { + status = "okay"; + st,prescaler = <47>; + + counter2: counter2 { + compatible = "st,stm32-counter"; + status = "okay"; + }; +}; diff --git a/app/boards/usbcanfd_dual_stm32g473xx.conf b/app/boards/usbcanfd_dual_stm32g473xx.conf new file mode 100644 index 0000000..86dd54c --- /dev/null +++ b/app/boards/usbcanfd_dual_stm32g473xx.conf @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CANNECTIVITY_USB_SELF_POWERED=n +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/app/boards/usbcanfd_dual_stm32g473xx.overlay b/app/boards/usbcanfd_dual_stm32g473xx.overlay new file mode 100644 index 0000000..91c0d9b --- /dev/null +++ b/app/boards/usbcanfd_dual_stm32g473xx.overlay @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "../app.overlay" + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counters2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan1>; + activity-leds = <&led_rx &led_tx>; + }; + channel1 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan2>; + activity-leds = <&led_rx2 &led_tx2>; + }; + }; +}; + +&timers2 { + st,prescaler = <159>; + counters2: counter { + status = "okay"; + }; +}; diff --git a/app/boards/usbcanfd_solo_stm32g431xx.conf b/app/boards/usbcanfd_solo_stm32g431xx.conf new file mode 100644 index 0000000..86dd54c --- /dev/null +++ b/app/boards/usbcanfd_solo_stm32g431xx.conf @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CANNECTIVITY_USB_SELF_POWERED=n +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/app/boards/usbcanfd_solo_stm32g431xx.overlay b/app/boards/usbcanfd_solo_stm32g431xx.overlay new file mode 100644 index 0000000..c08ce97 --- /dev/null +++ b/app/boards/usbcanfd_solo_stm32g431xx.overlay @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026 Oleksii Mamontov + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "../app.overlay" + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counters2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan1>; + activity-leds = <&led_rx &led_tx>; + }; + }; +}; + +&timers2 { + st,prescaler = <159>; + counters2: counter { + status = "okay"; + }; +}; diff --git a/app/src/led.c b/app/src/led.c index 7d9e1b4..04624e8 100644 --- a/app/src/led.c +++ b/app/src/led.c @@ -586,4 +586,4 @@ int cannectivity_led_init(void) k_timer_start(&led_tick_timer, K_MSEC(LED_TICK_MS), K_MSEC(LED_TICK_MS)); return 0; -} +} \ No newline at end of file