From 1511b910502f2ee5f6e215613a0160c2f0e31b1f Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Mon, 8 Dec 2025 11:52:25 +0100 Subject: [PATCH] Fix Zephyr 4.2.0 configuration issues - Remove CONFIG_BOARD_EWS from defconfig (auto-generated in new Zephyr) - Replace deprecated 'bus-speed' with 'bit-rate' properties for FDCAN - Replace deprecated 'bus-speed-data' with 'bit-rate-data' properties --- .../boards/arm/ews/ews.dts | 4 +- .../boards/arm/ews/ews_board.dts | 104 ++++++++++++++++++ .../boards/arm/ews/ews_defconfig | 1 - 3 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 firmware/canfd_cdc_composite/boards/arm/ews/ews_board.dts diff --git a/firmware/canfd_cdc_composite/boards/arm/ews/ews.dts b/firmware/canfd_cdc_composite/boards/arm/ews/ews.dts index 6c8bd9f..a3672a2 100644 --- a/firmware/canfd_cdc_composite/boards/arm/ews/ews.dts +++ b/firmware/canfd_cdc_composite/boards/arm/ews/ews.dts @@ -64,8 +64,8 @@ &fdcan2 { pinctrl-0 = <&fdcan2_rx_pb0 &fdcan2_tx_pb1>; pinctrl-names = "default"; - bus-speed = <500000>; - bus-speed-data = <2000000>; + bit-rate = <500000>; + bit-rate-data = <2000000>; status = "okay"; }; diff --git a/firmware/canfd_cdc_composite/boards/arm/ews/ews_board.dts b/firmware/canfd_cdc_composite/boards/arm/ews/ews_board.dts new file mode 100644 index 0000000..6671fed --- /dev/null +++ b/firmware/canfd_cdc_composite/boards/arm/ews/ews_board.dts @@ -0,0 +1,104 @@ +/dts-v1/; +#include +#include + +/ { + model = "EWS Board STM32G0B1KBU6"; + compatible = "ews,ews"; + + chosen { + zephyr,console = &cdc_acm_uart0; + zephyr,shell-uart = &cdc_acm_uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,canbus = &fdcan1; + }; + + leds { + compatible = "gpio-leds"; + status_led: led_0 { + gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>; + label = "Status LED"; + }; + }; + + pfets { + compatible = "gpio-leds"; + pfet1: pfet_1 { + gpios = <&gpioa 8 GPIO_ACTIVE_HIGH>; + label = "PFET1 Control"; + }; + pfet2: pfet_2 { + gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>; + label = "PFET2 Control"; + }; + }; + + aliases { + led0 = &status_led; + pfet0 = &pfet1; + pfet1 = &pfet2; + }; +}; + +&clk_hsi { + status = "okay"; +}; + +&pll { + div-m = <1>; + mul-n = <8>; + div-q = <2>; + div-r = <2>; + clocks = <&clk_hsi>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; +}; + +&fdcan1 { + pinctrl-0 = <&fdcan1_rx_pb0 &fdcan1_tx_pb1>; + pinctrl-names = "default"; + bus-speed = <500000>; + bus-speed-data = <2000000>; + status = "okay"; +}; + +&usb { + pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>; + pinctrl-names = "default"; + status = "okay"; + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + +&gpioa { + status = "okay"; +}; + +&gpiob { + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x00002000>; + }; + slot0_partition: partition@2000 { + label = "image-0"; + reg = <0x00002000 0x0001E000>; + }; + }; +}; \ No newline at end of file diff --git a/firmware/canfd_cdc_composite/boards/arm/ews/ews_defconfig b/firmware/canfd_cdc_composite/boards/arm/ews/ews_defconfig index 8b28590..360dd30 100644 --- a/firmware/canfd_cdc_composite/boards/arm/ews/ews_defconfig +++ b/firmware/canfd_cdc_composite/boards/arm/ews/ews_defconfig @@ -1,6 +1,5 @@ # EWS Board Configuration -CONFIG_BOARD_EWS=y CONFIG_SOC_SERIES_STM32G0X=y CONFIG_SOC_STM32G0B1XX=y