Upgrade to Zephyr v4.3 and migrate boards

Also use new Zephyr CI environment and compile all boards.

Board migration script example:

python ../zephyr/scripts/utils/board_v1_to_v2.py --board-root . \
  -v libresolar -g libresolar -b pwm_2420_lus -s stm32l072xx
This commit is contained in:
Martin Jäger
2026-03-08 06:25:56 +01:00
parent 5622cb97e6
commit 167fc5d3ac
92 changed files with 388 additions and 606 deletions
-6
View File
@@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
board_check_revision(
FORMAT MAJOR.MINOR.PATCH
DEFAULT_REVISION 0.7.1
)
-3
View File
@@ -1,3 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
board_check_revision(FORMAT MAJOR.MINOR.PATCH)
-8
View File
@@ -1,8 +0,0 @@
# STM32G474RE Nucleo board configuration
# Copyright (c) 2019 STMicroelectronics.
# SPDX-License-Identifier: Apache-2.0
config BOARD_NUCLEO_G474RE
bool "Nucleo G474RE Development Board"
depends on SOC_STM32G474XX
@@ -1,14 +0,0 @@
# STM32G474RE Nucleo board configuration
# Copyright (c) 2019 STMicroelectronics.
# SPDX-License-Identifier: Apache-2.0
if BOARD_NUCLEO_G474RE
config BOARD
default "nucleo_g474re"
config LIBRE_SOLAR_TYPE_ID
default 0
endif # BOARD_NUCLEO_G431RB
-10
View File
@@ -1,10 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# use target=stm32g474rbtx instead of stm32g474retx
# to allow board re-flashing (see PR #23230)
board_runner_args(pyocd "--target=stm32g474rbtx")
board_runner_args(jlink "--device=STM32G474RE" "--speed=4000" "--reset-after-load")
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
-290
View File
@@ -1,290 +0,0 @@
/*
* Copyright (c) 2019 STMicroelectronics.
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* This is a dummy charge controller board for testing new features using the STM32G474 MCU
*
* IMPORTANT: You have to remove the VREF jumper on the Nucleo board to make it work. Otherwise
* the MCU will get stuck while trying to generate a reference voltage at VREF+ pin.
*/
/dts-v1/;
#include <st/g4/stm32g474Xe.dtsi>
#include <st/g4/stm32g474r(b-c-e)tx-pinctrl.dtsi>
/ {
model = "STMicroelectronics STM32G474RE-NUCLEO board";
compatible = "st,stm32g474re-nucleo";
pcb {
compatible = "charge-controller";
type = "Nucleo G474 dummy charge controller";
version-str = "v0.1";
version-num = <1>;
hs-voltage-max = <80>;
ls-voltage-max = <32>;
dcdc-current-max = <20>;
};
chosen {
zephyr,console = &lpuart1;
zephyr,shell-uart = &lpuart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,can-primary = &can1;
};
leds {
compatible = "charlieplexing-leds";
gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
pwr {
states = <1>;
};
};
outputs {
compatible = "outputs";
can_en {
gpios = <&gpiob 11 GPIO_ACTIVE_LOW>;
};
};
adc-inputs {
compatible = "adc-inputs";
v-low {
io-channels = <&adc1 12>;
multiplier = <105600>;
divider = <5600>;
};
v-high {
io-channels = <&adc1 15>;
multiplier = <102200>;
divider = <2200>;
};
vref-mcu {
io-channels = <&adc1 18>;
multiplier = <1>;
divider = <1>;
};
temp-mcu {
io-channels = <&adc1 16>;
multiplier = <1>;
divider = <1>;
};
i-dcdc {
io-channels = <&adc2 1>;
// amp gain: 25, resistor: 2 mOhm
multiplier = <1000>; // 1000
divider = <50>; // 2*25
};
};
gpio_keys {
compatible = "gpio-keys";
user_button: button {
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
};
};
aliases {
sw0 = &user_button;
uart-dbg = &lpuart1;
uart-uext = &usart1;
spi-uext = &spi1;
i2c-uext = &i2c1;
};
soc {
hrtim1: timers@40016800 {
compatible = "st,stm32-timers";
reg = <0x40016800 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x04000000>;
interrupts = <67 0>, <68 0>, <69 0>, <70 0>,
<71 0>, <72 0>, <73 0>, <74 0>;
interrupt-names = "master", "tima", "timb", "timc",
"timd", "time", "flt", "timf";
status = "okay";
};
/* below nodes are required until following PR is merged:
* https://github.com/zephyrproject-rtos/hal_stm32/pull/87
*/
pinctrl: pin-controller@48000000 {
hrtim1_cha1_pa8: hrtim1_cha1_pa8 {
pinmux = <STM32_PINMUX('A', 8, AF13)>;
};
hrtim1_cha2_pa9: hrtim1_cha2_pa9 {
pinmux = <STM32_PINMUX('A', 9, AF13)>;
};
hrtim1_chb1_pa10: hrtim1_chb1_pa10 {
pinmux = <STM32_PINMUX('A', 10, AF13)>;
};
hrtim1_chb2_pa11: hrtim1_chb2_pa11 {
pinmux = <STM32_PINMUX('A', 11, AF13)>;
};
hrtim1_chc1_pb12: hrtim1_chc1_pb12 {
pinmux = <STM32_PINMUX('B', 12, AF13)>;
};
hrtim1_chc2_pb13: hrtim1_chc2_pb13 {
pinmux = <STM32_PINMUX('B', 13, AF13)>;
};
hrtim1_chd1_pb14: hrtim1_chd1_pb14 {
pinmux = <STM32_PINMUX('B', 14, AF13)>;
};
hrtim1_chd2_pb15: hrtim1_chd2_pb15 {
pinmux = <STM32_PINMUX('B', 15, AF13)>;
};
};
};
};
&clk_hse {
clock-frequency = <DT_FREQ_M(24)>;
status = "okay";
};
&pll {
div-m = <6>;
mul-n = <85>;
div-p = <7>;
div-q = <2>;
div-r = <2>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(170)>;
ahb-prescaler = <1>;
apb1-prescaler = <1>;
apb2-prescaler = <1>;
};
&usart1 {
pinctrl-0 = <&usart1_tx_pc4 &usart1_rx_pc5>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};
&usart1_rx_pc5 {
bias-pull-up; // avoid junk characters if pin is left floating
};
&lpuart1 {
pinctrl-0 = <&lpuart1_tx_pa2 &lpuart1_rx_pa3>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};
&lpuart1_rx_pa3 {
bias-pull-up; // avoid junk characters if pin is left floating
};
&i2c1 {
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
pinctrl-names = "default";
status = "okay";
};
&spi1 {
pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pb3
&spi1_miso_pa6 &spi1_mosi_pa7>;
pinctrl-names = "default";
status = "okay";
};
&hrtim1 {
status = "okay";
halfbridge: halfbridge {
compatible = "half-bridge";
pinctrl-0 = <&hrtim1_cha1_pa8 &hrtim1_cha2_pa9>;
pinctrl-names = "default";
frequency = <70000>;
deadtime = <300>;
};
};
/*
// alternative to HRTIM
&timers1 {
status = "okay";
halfbridge: halfbridge {
compatible = "half-bridge";
pinctrl-0 = <&tim1_ch1_pa8 &tim1_ch1n_pb13>;
pinctrl-names = "default";
frequency = <70000>;
deadtime = <300>;
};
};
*/
&rtc {
status = "okay";
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Set 2Kb of storage at the end of the 128Kb of flash */
storage_partition: partition@1f800 {
reg = <0x0001f800 0x00000800>;
};
};
};
&iwdg {
status = "okay";
};
&rng {
status = "okay";
};
&adc1 {
pinctrl-0 = <&adc1_in1_pa0>;
pinctrl-names = "default";
status = "okay";
};
&can1 {
pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>;
pinctrl-names = "default";
bus-speed = <500000>;
bus-speed-data = <500000>;
sjw = <1>;
sjw-data = <1>;
sample-point = <875>;
sample-point-data = <875>;
status = "okay";
};
@@ -1,22 +0,0 @@
identifier: nucleo_g474re
name: ST Nucleo G474RE
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 128
flash: 512
supported:
- nvs
- pwm
- i2c
- gpio
- usb device
- counter
- spi
- watchdog
- adc
- can
- canfd
@@ -1,31 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32G4X=y
CONFIG_SOC_STM32G474XX=y
# enable uart driver
CONFIG_SERIAL=y
# enable pinmux
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# Console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable MPU
CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y
CONFIG_CAN=y
CONFIG_THINGSET_CAN=y
CONFIG_ISOTP=y
@@ -1,7 +0,0 @@
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32g4x.cfg]
reset_config srst_only
-6
View File
@@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
board_check_revision(
FORMAT MAJOR.MINOR.PATCH
DEFAULT_REVISION 0.3
)
@@ -3,9 +3,6 @@
if BOARD_MPPT_1210_HUS
config BOARD
default "mppt_1210_hus"
config LIBRE_SOLAR_TYPE_ID
default 4
@@ -2,5 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_MPPT_1210_HUS
bool "Libre Solar MPPT 1210 HUS"
depends on SOC_STM32L072XX
select SOC_STM32L072XX
+11
View File
@@ -0,0 +1,11 @@
board:
name: mppt_1210_hus
vendor: libresolar
socs:
- name: stm32l072xx
revision:
format: major.minor.patch
default: "0.7.0"
revisions:
- name: "0.4.0"
- name: "0.7.0"
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32L0X=y
CONFIG_SOC_STM32L072XX=y
CONFIG_CLOCK_CONTROL=y
CONFIG_PINCTRL=y
@@ -3,9 +3,6 @@
if BOARD_MPPT_2420_HC
config BOARD
default "mppt_2420_hc"
config LIBRE_SOLAR_TYPE_ID
default 8
@@ -2,5 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_MPPT_2420_HC
bool "Libre Solar MPPT 2420 HC"
depends on SOC_STM32G431XX
select SOC_STM32G431XX
+11
View File
@@ -0,0 +1,11 @@
board:
name: mppt_2420_hc
vendor: libresolar
socs:
- name: stm32g431xx
revision:
format: major.minor.patch
default: "0.2.0"
revisions:
- name: "0.1.0"
- name: "0.2.0"
@@ -212,14 +212,10 @@
};
};
&can1 {
&fdcan1 {
pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>;
pinctrl-names = "default";
bus-speed = <500000>;
bus-speed-data = <500000>;
sjw = <1>;
sjw-data = <1>;
sample-point = <875>;
sample-point-data = <875>;
bitrate = <500000>;
bitrate-data = <2000000>;
status = "okay";
};
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32G4X=y
CONFIG_SOC_STM32G431XX=y
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
@@ -3,9 +3,6 @@
if BOARD_MPPT_2420_HPX
config BOARD
default "mppt_2420_hpx"
config LIBRE_SOLAR_TYPE_ID
default 7
@@ -2,5 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_MPPT_2420_HPX
bool "Libre Solar MPPT 2420 HPX"
depends on SOC_STM32G431XX
select SOC_STM32G431XX
@@ -0,0 +1,5 @@
board:
name: mppt_2420_hpx
vendor: libresolar
socs:
- name: stm32g431xx
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32G4X=y
CONFIG_SOC_STM32G431XX=y
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
@@ -3,9 +3,6 @@
if BOARD_MPPT_2420_LC
config BOARD
default "mppt_2420_lc"
config LIBRE_SOLAR_TYPE_ID
default 1
@@ -2,5 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_MPPT_2420_LC
bool "Libre Solar MPPT 2420 LC"
depends on SOC_STM32F072XB
select SOC_STM32F072XB
+5
View File
@@ -0,0 +1,5 @@
board:
name: mppt_2420_lc
vendor: libresolar
socs:
- name: stm32f072xb
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32F0X=y
CONFIG_SOC_STM32F072XB=y
CONFIG_CLOCK_CONTROL=y
CONFIG_PINCTRL=y
@@ -3,9 +3,6 @@
if BOARD_MPPT_2420_RC
config BOARD
default "mppt_2420_rc"
config LIBRE_SOLAR_TYPE_ID
default 0
@@ -2,5 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_MPPT_2420_RC
bool "Libre Solar MPPT 2420 RC"
depends on SOC_STM32G431XX
select SOC_STM32G431XX
+5
View File
@@ -0,0 +1,5 @@
board:
name: mppt_2420_rc
vendor: libresolar
socs:
- name: stm32f072xb
@@ -219,14 +219,10 @@
};
};
&can1 {
&fdcan1 {
pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>;
pinctrl-names = "default";
bus-speed = <500000>;
bus-speed-data = <500000>;
sjw = <1>;
sjw-data = <1>;
sample-point = <875>;
sample-point-data = <875>;
bitrate = <500000>;
bitrate-data = <2000000>;
status = "okay";
};
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32G4X=y
CONFIG_SOC_STM32G431XX=y
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
@@ -3,9 +3,6 @@
if BOARD_PWM_2420_LUS
config BOARD
default "pwm_2420_lus"
config LIBRE_SOLAR_TYPE_ID
default 5
@@ -2,5 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_PWM_2420_LUS
bool "Libre Solar PWM 2420 LUS"
depends on SOC_STM32L072XX
select SOC_STM32L072XX
+11
View File
@@ -0,0 +1,11 @@
board:
name: pwm_2420_lus
vendor: libresolar
socs:
- name: stm32l072xx
revision:
format: major.minor.patch
default: "0.3.0"
revisions:
- name: "0.2.0"
- name: "0.3.0"
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32L0X=y
CONFIG_SOC_STM32L072XX=y
CONFIG_CLOCK_CONTROL=y
CONFIG_PINCTRL=y