From c03e938c304c4a8bb210bb31e16ebe172265583c Mon Sep 17 00:00:00 2001 From: Alexander Kozhinov Date: Sun, 8 Dec 2024 09:29:08 +0100 Subject: [PATCH] app: boards: add configuration for the mks_canable_v20 board Add configuration for the mks_canable_v20 board. Signed-off-by: Alexander Kozhinov --- .../mks_canable_v20/mks_canable_v20.conf | 3 ++ .../mks_canable_v20/mks_canable_v20.overlay | 34 +++++++++++++++++++ app/sample.yaml | 1 + 3 files changed, 38 insertions(+) create mode 100644 app/boards/makerbase/mks_canable_v20/mks_canable_v20.conf create mode 100644 app/boards/makerbase/mks_canable_v20/mks_canable_v20.overlay diff --git a/app/boards/makerbase/mks_canable_v20/mks_canable_v20.conf b/app/boards/makerbase/mks_canable_v20/mks_canable_v20.conf new file mode 100644 index 0000000..5687810 --- /dev/null +++ b/app/boards/makerbase/mks_canable_v20/mks_canable_v20.conf @@ -0,0 +1,3 @@ +# The two lines below are needed to reduce flash usage +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/app/boards/makerbase/mks_canable_v20/mks_canable_v20.overlay b/app/boards/makerbase/mks_canable_v20/mks_canable_v20.overlay new file mode 100644 index 0000000..496df21 --- /dev/null +++ b/app/boards/makerbase/mks_canable_v20/mks_canable_v20.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Alexander Kozhinov + * + * SPDX-License-Identifier: Apache-2.0 + */ + + #include + +/ { + cannectivity: cannectivity { + compatible = "cannectivity"; + timestamp-counter = <&counters2>; + + channel0 { + compatible = "cannectivity-channel"; + can-controller = <&fdcan1>; + state-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>; /* blue led */ + activity-gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; /* green led */ + }; + }; +}; + +&zephyr_udc0 { + gs_usb0: gs_usb0 { + compatible = "gs_usb"; + }; +}; + +&timers2 { + st,prescaler = <159>; + counters2: counter { + status = "okay"; + }; +}; diff --git a/app/sample.yaml b/app/sample.yaml index 0346996..7faadca 100644 --- a/app/sample.yaml +++ b/app/sample.yaml @@ -27,6 +27,7 @@ tests: - usb2canfdv1 - candlelight - ucan + - mks_canable_v20 app.cannectivity.sof: depends_on: - usb_device