diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index d35b33c..051bf6e 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -52,3 +52,7 @@ jobs: - name: Run tests run: | west build -b native_sim -t run tests -p + + - name: Run driver tests + run: | + west twister -T tests/drivers --integration --inline-logs diff --git a/.gitignore b/.gitignore index 4d21034..bbb4e18 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # folders generated by west build +twister-out* # editors .vscode/* diff --git a/tests/drivers/half_bridge/app.overlay b/tests/drivers/half_bridge/boards/native_sim.overlay similarity index 100% rename from tests/drivers/half_bridge/app.overlay rename to tests/drivers/half_bridge/boards/native_sim.overlay diff --git a/tests/drivers/half_bridge/boards/native_sim_native_64.overlay b/tests/drivers/half_bridge/boards/native_sim_native_64.overlay new file mode 100644 index 0000000..1e9e709 --- /dev/null +++ b/tests/drivers/half_bridge/boards/native_sim_native_64.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) The Libre Solar Project Contributors + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + halfbridge: half-bridge { + compatible = "libresolar,half-bridge-emul"; + clock-frequency = <24000000>; + frequency = <70000>; + deadtime-ns = <300>; + }; +}; diff --git a/tests/drivers/half_bridge/boards/nucleo_g474re.overlay b/tests/drivers/half_bridge/boards/nucleo_g474re.overlay new file mode 100644 index 0000000..d6edbd4 --- /dev/null +++ b/tests/drivers/half_bridge/boards/nucleo_g474re.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) The Libre Solar Project Contributors + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* HRTIM node is not yet defined in Zephyr's STM32G4 devicetree */ + +/ { + soc { + hrtim1: timers@40016800 { + compatible = "st,stm32-timers"; + reg = <0x40016800 0x400>; + clocks = <&rcc STM32_CLOCK(APB2, 26)>, + <&rcc STM32_SRC_TIMPCLK2 NO_SEL>; + resets = <&rctl STM32_RESET(APB2, 26)>; + 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"; + st,prescaler = <0>; + status = "okay"; + + halfbridge: halfbridge { + compatible = "libresolar,stm32-hrtim-half-bridge"; + pinctrl-0 = <&hrtim1_cha1_pa8 &hrtim1_cha2_pa9>; + pinctrl-names = "default"; + frequency = <70000>; + deadtime-ns = <300>; + adc-trigger; + }; + }; + }; +}; diff --git a/tests/drivers/half_bridge/testcase.yaml b/tests/drivers/half_bridge/testcase.yaml index df62d40..7f9c50d 100644 --- a/tests/drivers/half_bridge/testcase.yaml +++ b/tests/drivers/half_bridge/testcase.yaml @@ -8,3 +8,19 @@ tests: - native_sim/native/64 integration_platforms: - native_sim + # The tests switch the power stage of real hardware, so they must only be built for the boards. + drivers.half_bridge.stm32: + build_only: true + tags: + - drivers + - half_bridge + platform_allow: + - mppt_1210_hus + - mppt_2420_hc + - mppt_2420_lc + - nucleo_g474re + integration_platforms: + - mppt_1210_hus + - mppt_2420_hc + - mppt_2420_lc + - nucleo_g474re