diff --git a/boards/arm/mppt_1210_hus/mppt_1210_hus.dts b/boards/arm/mppt_1210_hus/mppt_1210_hus.dts index 36d109f..7567a30 100644 --- a/boards/arm/mppt_1210_hus/mppt_1210_hus.dts +++ b/boards/arm/mppt_1210_hus/mppt_1210_hus.dts @@ -147,6 +147,25 @@ }; }; +&clk_hsi { + status = "okay"; +}; + +&pll { + div = <2>; + mul = <4>; + clocks = <&clk_hsi>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; current-speed = <115200>; diff --git a/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig b/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig index 363a83f..0f05e44 100644 --- a/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig +++ b/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig @@ -3,33 +3,18 @@ CONFIG_SOC_SERIES_STM32L0X=y CONFIG_SOC_STM32L072XX=y -# General Kernel Options -CONFIG_CORTEX_M_SYSTICK=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000 +#CONFIG_ARM_MPU=y + +CONFIG_CLOCK_CONTROL=y + +CONFIG_PINMUX=y + +CONFIG_GPIO=y -# Serial Drivers CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y + CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -# Pinmux Driver -CONFIG_PINMUX=y - -# GPIO Controller -CONFIG_GPIO=y - -# Clock configuration -CONFIG_CLOCK_CONTROL=y -# SYSCLK selection -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y - -# PLL configuration -CONFIG_CLOCK_STM32_PLL_SRC_HSI=y -CONFIG_CLOCK_STM32_PLL_MULTIPLIER=4 -CONFIG_CLOCK_STM32_PLL_DIVISOR=2 -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 - CONFIG_EEPROM=y CONFIG_EEPROM_STM32=y diff --git a/boards/arm/mppt_2420_hc/mppt_2420_hc.dts b/boards/arm/mppt_2420_hc/mppt_2420_hc.dts index 932c567..6a023ac 100644 --- a/boards/arm/mppt_2420_hc/mppt_2420_hc.dts +++ b/boards/arm/mppt_2420_hc/mppt_2420_hc.dts @@ -123,6 +123,28 @@ }; }; +&clk_hsi { + status = "okay"; +}; + +&pll { + div-m = <4>; + mul-n = <75>; + 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>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; current-speed = <115200>; diff --git a/boards/arm/mppt_2420_hc/mppt_2420_hc_defconfig b/boards/arm/mppt_2420_hc/mppt_2420_hc_defconfig index e1fdb80..819d91c 100644 --- a/boards/arm/mppt_2420_hc/mppt_2420_hc_defconfig +++ b/boards/arm/mppt_2420_hc/mppt_2420_hc_defconfig @@ -3,60 +3,20 @@ CONFIG_SOC_SERIES_STM32G4X=y CONFIG_SOC_STM32G431XX=y -# 170MHz system clock only in 'boost power' mode. RM0440, section -# 5.1.5 states that the R1MODE bit must be cleared before system can -# be 170MHz. This requires an update to the stm32 clock control -# driver, so default to 150MHz until then. -# CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=170000000 - -# 150MHz system clock in 'normal power' mode -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=150000000 - -# enable uart driver -CONFIG_SERIAL=y - -# enable pinmux -CONFIG_PINMUX=y - -# enable GPIO -CONFIG_GPIO=y - -# clock configuration -CONFIG_CLOCK_CONTROL=y - -# Use PLLCLK for SYSCLK -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y - -# Use HSI (16MHz) to feed into PLL -CONFIG_CLOCK_STM32_PLL_SRC_HSI=y - -CONFIG_CLOCK_STM32_PLL_M_DIVISOR=4 -CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7 -CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2 -CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2 - -# Produce 150MHz clock at PLLCLK output -CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=75 - -# Comment out above and uncomment below for 170MHz. Note that you -# must have configured the mcu for boost power mode. -# CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=85 - -# Produce Max (150MHz or 170MHz) HCLK -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 - -# Produce Max (150MHz or 170MHz) APB1 clocks and APB2 clocks -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 -CONFIG_CLOCK_STM32_APB2_PRESCALER=1 - -# Console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable MPU CONFIG_ARM_MPU=y CONFIG_MPU_ALLOW_FLASH_WRITE=y +CONFIG_CLOCK_CONTROL=y + +CONFIG_PINMUX=y + +CONFIG_GPIO=y + +CONFIG_SERIAL=y + +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + CONFIG_PWM=y CONFIG_CAN=y diff --git a/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts b/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts index ee44f73..3f3c04f 100644 --- a/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts +++ b/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts @@ -144,6 +144,28 @@ }; }; +&clk_hsi{ + status = "okay"; +}; + +&pll { + div-m = <4>; + mul-n = <75>; + 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>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; current-speed = <115200>; diff --git a/boards/arm/mppt_2420_hpx/mppt_2420_hpx_defconfig b/boards/arm/mppt_2420_hpx/mppt_2420_hpx_defconfig index 7f67e7f..449faa2 100644 --- a/boards/arm/mppt_2420_hpx/mppt_2420_hpx_defconfig +++ b/boards/arm/mppt_2420_hpx/mppt_2420_hpx_defconfig @@ -3,59 +3,19 @@ CONFIG_SOC_SERIES_STM32G4X=y CONFIG_SOC_STM32G431XX=y -# 170MHz system clock only in 'boost power' mode. RM0440, section -# 5.1.5 states that the R1MODE bit must be cleared before system can -# be 170MHz. This requires an update to the stm32 clock control -# driver, so default to 150MHz until then. -# CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=170000000 +CONFIG_ARM_MPU=y -# 150MHz system clock in 'normal power' mode -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=150000000 - -# enable uart driver -CONFIG_SERIAL=y - -# enable pinmux -CONFIG_PINMUX=y - -# enable GPIO -CONFIG_GPIO=y - -# clock configuration CONFIG_CLOCK_CONTROL=y -# Use PLLCLK for SYSCLK -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y +CONFIG_PINMUX=y -# Use HSI (16MHz) to feed into PLL -CONFIG_CLOCK_STM32_PLL_SRC_HSI=y +CONFIG_GPIO=y -CONFIG_CLOCK_STM32_PLL_M_DIVISOR=4 -CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7 -CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2 -CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2 +CONFIG_SERIAL=y -# Produce 150MHz clock at PLLCLK output -CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=75 - -# Comment out above and uncomment below for 170MHz. Note that you -# must have configured the mcu for boost power mode. -# CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=85 - -# Produce Max (150MHz or 170MHz) HCLK -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 - -# Produce Max (150MHz or 170MHz) APB1 clocks and APB2 clocks -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 -CONFIG_CLOCK_STM32_APB2_PRESCALER=1 - -# Console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -# Enable MPU -CONFIG_ARM_MPU=y - CONFIG_PWM=y CONFIG_I2C=y diff --git a/boards/arm/mppt_2420_lc/mppt_2420_lc.dts b/boards/arm/mppt_2420_lc/mppt_2420_lc.dts index 139a1a0..91a0cb7 100644 --- a/boards/arm/mppt_2420_lc/mppt_2420_lc.dts +++ b/boards/arm/mppt_2420_lc/mppt_2420_lc.dts @@ -144,6 +144,25 @@ }; }; +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&pll { + clocks = <&clk_hse>; + prediv = <1>; + mul = <6>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <2>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; current-speed = <115200>; diff --git a/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig b/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig index 55cc9a1..2c1294a 100644 --- a/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig +++ b/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig @@ -3,36 +3,23 @@ CONFIG_SOC_SERIES_STM32F0X=y CONFIG_SOC_STM32F072XB=y -# General Kernel Options -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 +#CONFIG_ARM_MPU=y -# Serial Drivers -CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y +CONFIG_CLOCK_CONTROL=y -# Pinmux Driver CONFIG_PINMUX=y -# GPIO Controller CONFIG_GPIO=y -# Clock configuration -CONFIG_CLOCK_CONTROL=y -# SYSCLK selection -CONFIG_CLOCK_STM32_HSE_CLOCK=8000000 -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y -# PLL configuration -CONFIG_CLOCK_STM32_PLL_SRC_HSE=y +CONFIG_SERIAL=y -CONFIG_CLOCK_STM32_PLL_MULTIPLIER=6 -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 - -CONFIG_CAN=y -CONFIG_THINGSET_CAN=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y CONFIG_I2C=y CONFIG_EEPROM=y CONFIG_EEPROM_AT24=y + +# too little RAM, can only be enabled if serial is disabled +#CONFIG_CAN=y +#CONFIG_THINGSET_CAN=y diff --git a/boards/arm/mppt_2420_rc/mppt_2420_rc.dts b/boards/arm/mppt_2420_rc/mppt_2420_rc.dts index 551b6cf..d84d1db 100644 --- a/boards/arm/mppt_2420_rc/mppt_2420_rc.dts +++ b/boards/arm/mppt_2420_rc/mppt_2420_rc.dts @@ -115,6 +115,28 @@ }; }; +&clk_hsi{ + status = "okay"; +}; + +&pll { + div-m = <4>; + mul-n = <75>; + 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>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; current-speed = <115200>; diff --git a/boards/arm/mppt_2420_rc/mppt_2420_rc_defconfig b/boards/arm/mppt_2420_rc/mppt_2420_rc_defconfig index fa6944e..89fb9b8 100644 --- a/boards/arm/mppt_2420_rc/mppt_2420_rc_defconfig +++ b/boards/arm/mppt_2420_rc/mppt_2420_rc_defconfig @@ -3,59 +3,19 @@ CONFIG_SOC_SERIES_STM32G4X=y CONFIG_SOC_STM32G431XX=y -# 170MHz system clock only in 'boost power' mode. RM0440, section -# 5.1.5 states that the R1MODE bit must be cleared before system can -# be 170MHz. This requires an update to the stm32 clock control -# driver, so default to 150MHz until then. -# CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=170000000 +CONFIG_ARM_MPU=y -# 150MHz system clock in 'normal power' mode -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=150000000 - -# enable uart driver -CONFIG_SERIAL=y - -# enable pinmux -CONFIG_PINMUX=y - -# enable GPIO -CONFIG_GPIO=y - -# clock configuration CONFIG_CLOCK_CONTROL=y -# Use PLLCLK for SYSCLK -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y +CONFIG_PINMUX=y -# Use HSI (16MHz) to feed into PLL -CONFIG_CLOCK_STM32_PLL_SRC_HSI=y +CONFIG_GPIO=y -CONFIG_CLOCK_STM32_PLL_M_DIVISOR=4 -CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7 -CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2 -CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2 +CONFIG_SERIAL=y -# Produce 150MHz clock at PLLCLK output -CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=75 - -# Comment out above and uncomment below for 170MHz. Note that you -# must have configured the mcu for boost power mode. -# CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=85 - -# Produce Max (150MHz or 170MHz) HCLK -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 - -# Produce Max (150MHz or 170MHz) APB1 clocks and APB2 clocks -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 -CONFIG_CLOCK_STM32_APB2_PRESCALER=1 - -# Console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -# Enable MPU -CONFIG_ARM_MPU=y - CONFIG_I2C=y CONFIG_EEPROM=y CONFIG_EEPROM_AT24=y diff --git a/boards/arm/nucleo_g474re/nucleo_g474re.dts b/boards/arm/nucleo_g474re/nucleo_g474re.dts index c0221b8..a368048 100644 --- a/boards/arm/nucleo_g474re/nucleo_g474re.dts +++ b/boards/arm/nucleo_g474re/nucleo_g474re.dts @@ -160,6 +160,29 @@ }; }; +&clk_hse { + clock-frequency = ; + 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 = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pc4 &usart1_rx_pc5>; current-speed = <115200>; diff --git a/boards/arm/nucleo_g474re/nucleo_g474re_defconfig b/boards/arm/nucleo_g474re/nucleo_g474re_defconfig index d9910c4..49a1284 100644 --- a/boards/arm/nucleo_g474re/nucleo_g474re_defconfig +++ b/boards/arm/nucleo_g474re/nucleo_g474re_defconfig @@ -3,14 +3,6 @@ CONFIG_SOC_SERIES_STM32G4X=y CONFIG_SOC_STM32G474XX=y -# 170MHz system clock only in 'boost power' mode. -# RM0440, section 5.1.5 states that the R1MODE bit -# must be cleared before system can be 170MHz. -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=170000000 - -# 150MHz system clock in 'normal power' mode -# CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=150000000 - # enable uart driver CONFIG_SERIAL=y @@ -20,35 +12,9 @@ CONFIG_PINMUX=y # enable GPIO CONFIG_GPIO=y -# clock configuration +# Enable Clocks CONFIG_CLOCK_CONTROL=y -# Use PLLCLK for SYSCLK -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y - -# Use HSE (24MHz) to feed into PLL -CONFIG_CLOCK_STM32_PLL_SRC_HSE=y -CONFIG_CLOCK_STM32_HSE_CLOCK=24000000 - -CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7 -CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2 -CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2 - -# Produce 150MHz clock at PLLCLK output -# CONFIG_CLOCK_STM32_PLL_M_DIVISOR=4 -# CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=75 - -# Produce 170MHz clock at PLLCLK output -CONFIG_CLOCK_STM32_PLL_M_DIVISOR=6 -CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=85 - -# Produce Max (150MHz or 170MHz) HCLK -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 - -# Produce Max (150MHz or 170MHz) APB1 clocks and APB2 clocks -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 -CONFIG_CLOCK_STM32_APB2_PRESCALER=1 - # Console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y diff --git a/boards/arm/pwm_2420_lus/pwm_2420_lus.dts b/boards/arm/pwm_2420_lus/pwm_2420_lus.dts index e5cb7fa..25063e8 100644 --- a/boards/arm/pwm_2420_lus/pwm_2420_lus.dts +++ b/boards/arm/pwm_2420_lus/pwm_2420_lus.dts @@ -167,6 +167,25 @@ }; }; +&clk_hsi { + status = "okay"; +}; + +&pll { + div = <2>; + mul = <4>; + clocks = <&clk_hsi>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + &usart1 { pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; current-speed = <115200>; diff --git a/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig b/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig index 363a83f..0f05e44 100644 --- a/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig +++ b/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig @@ -3,33 +3,18 @@ CONFIG_SOC_SERIES_STM32L0X=y CONFIG_SOC_STM32L072XX=y -# General Kernel Options -CONFIG_CORTEX_M_SYSTICK=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000 +#CONFIG_ARM_MPU=y + +CONFIG_CLOCK_CONTROL=y + +CONFIG_PINMUX=y + +CONFIG_GPIO=y -# Serial Drivers CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y + CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -# Pinmux Driver -CONFIG_PINMUX=y - -# GPIO Controller -CONFIG_GPIO=y - -# Clock configuration -CONFIG_CLOCK_CONTROL=y -# SYSCLK selection -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y - -# PLL configuration -CONFIG_CLOCK_STM32_PLL_SRC_HSI=y -CONFIG_CLOCK_STM32_PLL_MULTIPLIER=4 -CONFIG_CLOCK_STM32_PLL_DIVISOR=2 -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 -CONFIG_CLOCK_STM32_APB1_PRESCALER=1 - CONFIG_EEPROM=y CONFIG_EEPROM_STM32=y diff --git a/platformio.ini b/platformio.ini index 3e73c80..236c7a8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -21,11 +21,11 @@ extra_configs = framework = zephyr #platform = https://github.com/platformio/platform-ststm32.git -platform = ststm32@~12.0.0 +platform = ststm32@~14.0.0 # Use customized Zephyr branch from Libre Solar repository platform_packages = - framework-zephyr@https://github.com/LibreSolar/zephyr#v2.5-branch + framework-zephyr@https://github.com/LibreSolar/zephyr#v2.6-branch #upload_protocol = mbed upload_protocol = stlink diff --git a/src/load_driver.c b/src/load_driver.c index 1f805f7..5108957 100644 --- a/src/load_driver.c +++ b/src/load_driver.c @@ -180,14 +180,15 @@ void usb_out_set(bool status) #if DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), charge_pump)) -#define CP_PWM_CONTROLLER (DT_PWMS_LABEL(DT_CHILD(DT_PATH(outputs), charge_pump))) -#define CP_PWM_PERIOD (DT_PHA(DT_CHILD(DT_PATH(outputs), charge_pump), pwms, period)) -#define CP_PWM_CHANNEL (DT_PHA(DT_CHILD(DT_PATH(outputs), charge_pump), pwms, channel)) +#define CP_PWMS DT_CHILD(DT_PATH(outputs), charge_pump) +#define CP_PWM_CONTROLLER DT_PWMS_CTLR(CP_PWMS) +#define CP_PWM_PERIOD DT_PWMS_PERIOD(CP_PWMS) +#define CP_PWM_CHANNEL DT_PWMS_CHANNEL(CP_PWMS) void load_cp_enable() { - const struct device *pwm_dev = device_get_binding(CP_PWM_CONTROLLER); - if (pwm_dev) { + const struct device *pwm_dev = DEVICE_DT_GET(CP_PWM_CONTROLLER); + if (device_is_ready(pwm_dev)) { // set to 50% duty cycle pwm_pin_set_nsec(pwm_dev, CP_PWM_CHANNEL, CP_PWM_PERIOD, CP_PWM_PERIOD / 2, 0); } diff --git a/zephyr/west.yml b/zephyr/west.yml index dec5167..b335788 100644 --- a/zephyr/west.yml +++ b/zephyr/west.yml @@ -7,7 +7,7 @@ manifest: projects: - name: zephyr remote: libresolar - revision: v2.5-branch + revision: v2.6-branch # path must be something else than zephyr as we get a Kconfig include recursion otherwise path: rtos import: