Skip to content

Commit

Permalink
app: boards: add mks_canable_v20
Browse files Browse the repository at this point in the history
A new low price board supporting CANnectvity

Signed-off-by: Alexander Kozhinov <[email protected]>
  • Loading branch information
KozhinovAlexander committed Dec 19, 2024
1 parent cbbbc9b commit b0c2a09
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/boards/makerbase/mks_canable_v20/mks_canable_v20.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# The three lines below are needed to reduce ROM usage
CONFIG_LTO=y
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

CONFIG_USB_DEVICE_GS_USB_TIMESTAMP=y
CONFIG_USB_DEVICE_GS_USB_TERMINATION=n
CONFIG_USB_DEVICE_GS_USB_MAX_CHANNELS=1
CONFIG_USB_DEVICE_GS_USB_TIMESTAMP_SOF=y
CONFIG_USB_DEVICE_GS_USB_IDENTIFICATION=y

CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_GS_USB_LOG_LEVEL_DBG=n
CONFIG_CANNECTIVITY_LOG_LEVEL_DBG=n

# Use candleLight_fw VID:PID:
CONFIG_CANNECTIVITY_USB_VID=0x1d50
CONFIG_CANNECTIVITY_USB_PID=0x606f
42 changes: 42 additions & 0 deletions app/boards/makerbase/mks_canable_v20/mks_canable_v20.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2024 Alexander Kozhinov <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
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 {
/* Timer with 1us tick used for CAN timestamp */
st,prescaler = <159>;
counters2: counter {
status = "okay";
};
};

&fdcan1 {
reg = <0x40006400 0x400>, <0x4000a400 0x450>;
reg-names = "m_can", "message_ram";
bosch,mram-cfg = <0x0 28 8 3 3 0 3 3>;
status = "okay";
};
1 change: 1 addition & 0 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tests:
- lpcxpresso55s16
- nucleo_h723zg
- usb2canfdv1
- mks_canable_v20
app.cannectivity.sof:
depends_on:
- usb_device
Expand Down

0 comments on commit b0c2a09

Please sign in to comment.