From fe9b82731acb2bcc57bfe5d3b6f85d958ec07a69 Mon Sep 17 00:00:00 2001 From: Alexander Kozhinov Date: Sat, 2 Nov 2024 13:55:48 +0100 Subject: [PATCH] boards: makerbase: mks_canable_v20: add new board MKS CANable V2.0 A cheap and affordable stm32g4 based simple CAN and CAN-FD to usb adapter board Reviewed-by: Erwan Gouriou Signed-off-by: Alexander Kozhinov --- boards/makerbase/index.rst | 10 + .../mks_canable_v20/Kconfig.mks_canable_v20 | 5 + boards/makerbase/mks_canable_v20/board.cmake | 6 + boards/makerbase/mks_canable_v20/board.yml | 6 + .../doc/img/mks_canable_v20.webp | Bin 0 -> 19276 bytes .../makerbase/mks_canable_v20/doc/index.rst | 173 ++++++++++++++++++ .../mks_canable_v20/mks_canable_v20.dts | 137 ++++++++++++++ .../mks_canable_v20/mks_canable_v20.yaml | 20 ++ .../mks_canable_v20/mks_canable_v20_defconfig | 7 + .../mks_canable_v20/support/openocd.cfg | 37 ++++ 10 files changed, 401 insertions(+) create mode 100644 boards/makerbase/index.rst create mode 100644 boards/makerbase/mks_canable_v20/Kconfig.mks_canable_v20 create mode 100644 boards/makerbase/mks_canable_v20/board.cmake create mode 100644 boards/makerbase/mks_canable_v20/board.yml create mode 100644 boards/makerbase/mks_canable_v20/doc/img/mks_canable_v20.webp create mode 100644 boards/makerbase/mks_canable_v20/doc/index.rst create mode 100644 boards/makerbase/mks_canable_v20/mks_canable_v20.dts create mode 100644 boards/makerbase/mks_canable_v20/mks_canable_v20.yaml create mode 100644 boards/makerbase/mks_canable_v20/mks_canable_v20_defconfig create mode 100644 boards/makerbase/mks_canable_v20/support/openocd.cfg diff --git a/boards/makerbase/index.rst b/boards/makerbase/index.rst new file mode 100644 index 00000000000000..468ca02f6800b9 --- /dev/null +++ b/boards/makerbase/index.rst @@ -0,0 +1,10 @@ +.. _boards-makerbase: + +Makerbase +################## + +.. toctree:: + :maxdepth: 1 + :glob: + + **/* diff --git a/boards/makerbase/mks_canable_v20/Kconfig.mks_canable_v20 b/boards/makerbase/mks_canable_v20/Kconfig.mks_canable_v20 new file mode 100644 index 00000000000000..ef676f4ffcd028 --- /dev/null +++ b/boards/makerbase/mks_canable_v20/Kconfig.mks_canable_v20 @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Alexander Kozhinov +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MKS_CANABLE_V20 + select SOC_STM32G431XX diff --git a/boards/makerbase/mks_canable_v20/board.cmake b/boards/makerbase/mks_canable_v20/board.cmake new file mode 100644 index 00000000000000..5b98199c697caf --- /dev/null +++ b/boards/makerbase/mks_canable_v20/board.cmake @@ -0,0 +1,6 @@ +# Copyright (c) 2024 Alexander Kozhinov +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd.cfg") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/makerbase/mks_canable_v20/board.yml b/boards/makerbase/mks_canable_v20/board.yml new file mode 100644 index 00000000000000..e8d763717692a4 --- /dev/null +++ b/boards/makerbase/mks_canable_v20/board.yml @@ -0,0 +1,6 @@ +board: + name: mks_canable_v20 + full_name: MKS Canable V2.0 + vendor: makerbase + socs: + - name: stm32g431xx diff --git a/boards/makerbase/mks_canable_v20/doc/img/mks_canable_v20.webp b/boards/makerbase/mks_canable_v20/doc/img/mks_canable_v20.webp new file mode 100644 index 0000000000000000000000000000000000000000..7f92a5ed81d7646692492fbc942e142d653afa91 GIT binary patch literal 19276 zcmV)IK)kD(?Yw0X~sJn@OdksUj%5S&<+T z31@EMap2e=+{o&1zq;If7PB48|E=(c#}}->di~7*8SU?v{>=3h`Pbqv-T#92tNj1{ zj|cuif2aM|*bDLB<-g|ty8iBa>V04A$NH}Y{nPyK{crXjz`n=*d;X{S5AuJue;pr< z=8y3I?SJljfcdB1!$2R^-mahIfB64@=dbGj{$K2V0e_$Wa{sCRL;WwmfB*mfp9%kb zzyJHhe(`_*EcB8!q>-&8jcFnx)f6mr)^IB@6H`K+C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dhKDBC#{ z2kr>0XLn_!W~s-z+XGEP$A}Nj@P1p!GT}!8B7m}qNRR*k0^R55Y~L@ywS%OUWp*6S zdmY)j*xDRZucDAkkb)~~GWzL0r@E6Af + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include + +/ { + model = "Makerbase MKS CANable V2.0"; + compatible = "makerbase,mks-canable-v20"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,canbus = &fdcan1; + }; + + aliases { + led0 = &blue_led; + led1 = &green_led; + mcuboot-led0 = &blue_led; + }; + + leds: leds { + compatible = "gpio-leds"; + blue_led: led_2 { + gpios = <&gpioa 15 GPIO_ACTIVE_LOW>; + label = "blue-status D2"; + }; + green_led: led_3 { + gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; + label = "green-word D3"; + }; + }; + + aliases { + led0 = &green_led; + }; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hsi { + status = "okay"; +}; + +&clk_hsi48 { + status = "okay"; +}; + +/* Adjust the pll for a SYSTEM Clock of 170MHz */ +&pll { + div-m = <4>; + mul-n = <85>; + div-p = <7>; + div-q = <2>; + div-r = <2>; + clocks = <&clk_hsi>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + +&rng { + clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x04000000>, + <&rcc STM32_SRC_HSI48 CLK48_SEL(0)>; + status = "okay"; +}; + +stm32_lp_tick_source: &lptim1 { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>, + <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>; + status = "okay"; +}; + +&rtc { + status = "okay"; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>, + <&rcc STM32_SRC_LSI RTC_SEL(2)>; +}; + +&iwdg { + status = "okay"; +}; + +&die_temp { + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(16)>; + read-only; + }; + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 DT_SIZE_K(48)>; + }; + }; +}; + +zephyr_udc0: &usb { + pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>; + pinctrl-names = "default"; + clocks = <&rcc STM32_CLOCK(APB1, 23U)>, + <&rcc STM32_SRC_HSI48 CLK48_SEL(0)>; + status = "okay"; + + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + +&fdcan1 { + pinctrl-0 = <&fdcan1_rx_pb8 &fdcan1_tx_pb9>; + pinctrl-names = "default"; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00001000>, + <&rcc STM32_SRC_PLL_Q FDCAN_SEL(1)>; + status = "okay"; +}; diff --git a/boards/makerbase/mks_canable_v20/mks_canable_v20.yaml b/boards/makerbase/mks_canable_v20/mks_canable_v20.yaml new file mode 100644 index 00000000000000..b7f5a00a444ba1 --- /dev/null +++ b/boards/makerbase/mks_canable_v20/mks_canable_v20.yaml @@ -0,0 +1,20 @@ +identifier: mks_canable_v20 +name: MKS CANable V2.0 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +ram: 32 +flash: 64 +supported: + - can + - gpio + - rng + - counter + - pinctrl + - usb_device + - usbd + - watchdog +vendor: makerbase diff --git a/boards/makerbase/mks_canable_v20/mks_canable_v20_defconfig b/boards/makerbase/mks_canable_v20/mks_canable_v20_defconfig new file mode 100644 index 00000000000000..fc07714f4b1f05 --- /dev/null +++ b/boards/makerbase/mks_canable_v20/mks_canable_v20_defconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2024 Alexander Kozhinov +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_GPIO=y +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y +CONFIG_ENTROPY_GENERATOR=y diff --git a/boards/makerbase/mks_canable_v20/support/openocd.cfg b/boards/makerbase/mks_canable_v20/support/openocd.cfg new file mode 100644 index 00000000000000..ef141f1e8f66d6 --- /dev/null +++ b/boards/makerbase/mks_canable_v20/support/openocd.cfg @@ -0,0 +1,37 @@ +# Copyright (c) 2024 Alexander Kozhinov +# SPDX-License-Identifier: Apache-2.0 + +proc version_compare {v1 v2} { + foreach n1 [split $v1 .] n2 [split $v2 .] { + if {$n1 < $n2} {return -1} + if {$n1 > $n2} {return 1} + } + return 0 +} + +set current_version [version] +regexp {([0-9]+\.[0-9]+\.[0-9]+)} $current_version -> current_version + +if {[version_compare $current_version "0.12.0"] >= 0} { + # OpenOCD version is 0.12.0 or newer + set transport_type dapdirect_swd +} else { + # OpenOCD version is older than 0.12.0 + set transport_type hla_swd +} + +source [find interface/stlink.cfg] +source [find target/stm32g4x.cfg] + +transport select $transport_type + +if {[version_compare $current_version "0.12.0"] >= 0} { + # OpenOCD version is 0.12.0 or newer + init + rtt setup 0x20000000 10000 "SEGGER RTT" + rtt start + rtt server start 9090 0 +} else { + # OpenOCD version is older than 0.12.0 + echo "Warn: Segger RTT is not supported for this OpenOCD version: $current_version" +}