From 9787397708232075c511347766f8cd344d55f873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Wed, 8 Apr 2020 17:10:40 +0200 Subject: [PATCH] Rename STM32L073 references to actually used STM32L072 --- README.md | 8 ++++---- ...XZ.ld.link_script.ld => STM32L072XZ.ld.link_script.ld} | 0 boards/arm/mppt_1210_hus/Kconfig.board | 2 +- boards/arm/mppt_1210_hus/board.cmake | 2 +- boards/arm/mppt_1210_hus/mppt_1210_hus.dts | 4 ++-- boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig | 2 +- boards/arm/pwm_2420_lus/Kconfig.board | 2 +- boards/arm/pwm_2420_lus/board.cmake | 2 +- boards/arm/pwm_2420_lus/pinmux.c | 1 - boards/arm/pwm_2420_lus/pwm_2420_lus.dts | 4 ++-- boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig | 2 +- boards/arm/pwm_2420_lus/support/openocd.cfg | 3 +-- boards/mppt_1210_hus.json | 6 +++--- boards/pwm_2420_lus.json | 6 +++--- platformio.ini | 2 +- src/mcu.h | 8 ++++---- src/pwm_switch_driver.c | 4 ++-- 17 files changed, 28 insertions(+), 30 deletions(-) rename boards/{STM32L073XZ.ld.link_script.ld => STM32L072XZ.ld.link_script.ld} (100%) diff --git a/README.md b/README.md index 5db2e39..a6ebe64 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Coding style is described [here](https://github.com/LibreSolar/coding-style). ## Supported devices -The software is configurable to support different charge controller PCBs with STM32F072, low-power STM32L072/3 or most recent STM32G431 MCUs: +The software is configurable to support different charge controller PCBs with STM32F072, low-power STM32L072 or most recent STM32G431 MCUs: - [Libre Solar MPPT 12/24V 20A with CAN](https://github.com/LibreSolar/MPPT-2420-LC) - [Libre Solar MPPT 12V 10A with USB](https://github.com/LibreSolar/MPPT-1210-HUS) @@ -26,7 +26,7 @@ git clone --recursive https://github.com/LibreSolar/charge-controller-firmware Unfortunately, the green GitHub "Clone or download" button does not include submodules. If you cloned the repository already and want to pull the submodules, run `git submodule update --init --recursive`. -### PlatfrormIO +### PlatformIO It is suggested to use Visual Studio Code and PlatformIO for firmware development, as it simplifies compiling and uploading the code a lot: @@ -97,9 +97,9 @@ st-flash 1.5.1 check the connection between the programmer (for example the ST-Link of the Nucleo board) and the charge controller. -## Bootloader Support (STM32L07x only) +## Bootloader Support (STM32L072 only) -The custom linker script file STM32L073XZ.ld.link_script.ld needs to be updated before generating the application firmware binary. For each application, the flash start address and the maximum code size need to be updated in this file. Currently, the locations 0x08001000 and 0x08018000 are used for applications 1 & 2 respectively. +The custom linker script file STM32L072XZ.ld.link_script.ld needs to be updated before generating the application firmware binary. For each application, the flash start address and the maximum code size need to be updated in this file. Currently, the locations 0x08001000 and 0x08018000 are used for applications 1 & 2 respectively. ## API documentation diff --git a/boards/STM32L073XZ.ld.link_script.ld b/boards/STM32L072XZ.ld.link_script.ld similarity index 100% rename from boards/STM32L073XZ.ld.link_script.ld rename to boards/STM32L072XZ.ld.link_script.ld diff --git a/boards/arm/mppt_1210_hus/Kconfig.board b/boards/arm/mppt_1210_hus/Kconfig.board index 9bf7c9d..8bf6425 100755 --- a/boards/arm/mppt_1210_hus/Kconfig.board +++ b/boards/arm/mppt_1210_hus/Kconfig.board @@ -3,4 +3,4 @@ config BOARD_MPPT_1210_HUS bool "Libre Solar MPPT 1210 HUS" - depends on SOC_STM32L073XX + depends on SOC_STM32L072XX diff --git a/boards/arm/mppt_1210_hus/board.cmake b/boards/arm/mppt_1210_hus/board.cmake index 6f20255..88eddae 100755 --- a/boards/arm/mppt_1210_hus/board.cmake +++ b/boards/arm/mppt_1210_hus/board.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -board_runner_args(jlink "--device=STM32L073RZ" "--speed=4000") +board_runner_args(jlink "--device=STM32L072RZ" "--speed=4000") include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/mppt_1210_hus/mppt_1210_hus.dts b/boards/arm/mppt_1210_hus/mppt_1210_hus.dts index fad3c9d..ca9c4f5 100755 --- a/boards/arm/mppt_1210_hus/mppt_1210_hus.dts +++ b/boards/arm/mppt_1210_hus/mppt_1210_hus.dts @@ -5,11 +5,11 @@ */ /dts-v1/; -#include +#include / { model = "Libre Solar MPPT 1210 HUS"; - compatible = "st,stm32l073"; + compatible = "st,stm32l072"; pcb { compatible = "charge-controller"; diff --git a/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig b/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig index 039e685..363a83f 100755 --- a/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig +++ b/boards/arm/mppt_1210_hus/mppt_1210_hus_defconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_SOC_SERIES_STM32L0X=y -CONFIG_SOC_STM32L073XX=y +CONFIG_SOC_STM32L072XX=y # General Kernel Options CONFIG_CORTEX_M_SYSTICK=y diff --git a/boards/arm/pwm_2420_lus/Kconfig.board b/boards/arm/pwm_2420_lus/Kconfig.board index 8d97758..bef6618 100644 --- a/boards/arm/pwm_2420_lus/Kconfig.board +++ b/boards/arm/pwm_2420_lus/Kconfig.board @@ -3,4 +3,4 @@ config BOARD_PWM_2420_LUS bool "Libre Solar PWM 2420 LUS" - depends on SOC_STM32L073XX + depends on SOC_STM32L072XX diff --git a/boards/arm/pwm_2420_lus/board.cmake b/boards/arm/pwm_2420_lus/board.cmake index 6f20255..88eddae 100644 --- a/boards/arm/pwm_2420_lus/board.cmake +++ b/boards/arm/pwm_2420_lus/board.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -board_runner_args(jlink "--device=STM32L073RZ" "--speed=4000") +board_runner_args(jlink "--device=STM32L072RZ" "--speed=4000") include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/pwm_2420_lus/pinmux.c b/boards/arm/pwm_2420_lus/pinmux.c index 2c6c532..0de5e57 100644 --- a/boards/arm/pwm_2420_lus/pinmux.c +++ b/boards/arm/pwm_2420_lus/pinmux.c @@ -12,7 +12,6 @@ #include -/* pin assignments for NUCLEO-L073RZ board */ static const struct pin_config pinconf[] = { #ifdef CONFIG_UART_1 {STM32_PIN_PA9, STM32L0_PINMUX_FUNC_PA9_USART1_TX}, diff --git a/boards/arm/pwm_2420_lus/pwm_2420_lus.dts b/boards/arm/pwm_2420_lus/pwm_2420_lus.dts index 5e16544..8ebd117 100644 --- a/boards/arm/pwm_2420_lus/pwm_2420_lus.dts +++ b/boards/arm/pwm_2420_lus/pwm_2420_lus.dts @@ -5,11 +5,11 @@ */ /dts-v1/; -#include +#include / { model = "Libre Solar PWM 2420 LUS"; - compatible = "st,stm32l073"; + compatible = "st,stm32l072"; pcb { compatible = "charge-controller"; diff --git a/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig b/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig index 039e685..363a83f 100644 --- a/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig +++ b/boards/arm/pwm_2420_lus/pwm_2420_lus_defconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_SOC_SERIES_STM32L0X=y -CONFIG_SOC_STM32L073XX=y +CONFIG_SOC_STM32L072XX=y # General Kernel Options CONFIG_CORTEX_M_SYSTICK=y diff --git a/boards/arm/pwm_2420_lus/support/openocd.cfg b/boards/arm/pwm_2420_lus/support/openocd.cfg index 00f68a6..40a0e5b 100644 --- a/boards/arm/pwm_2420_lus/support/openocd.cfg +++ b/boards/arm/pwm_2420_lus/support/openocd.cfg @@ -1,5 +1,4 @@ -# This is an ST NUCLEO-L073RZ board with single STM32L073RZ chip. -# http://www.st.com/en/evaluation-tools/nucleo-l073rz.html + source [find interface/stlink.cfg] transport select hla_swd diff --git a/boards/mppt_1210_hus.json b/boards/mppt_1210_hus.json index ae5817f..b4e2b8f 100644 --- a/boards/mppt_1210_hus.json +++ b/boards/mppt_1210_hus.json @@ -1,19 +1,19 @@ { "build": { "cpu": "cortex-m0plus", - "extra_flags": "-DSTM32L073xx", + "extra_flags": "-DSTM32L072xx", "f_cpu": "32000000L", "framework_extra_flags": { "arduino": "-D__CORTEX_SC=0" }, - "mcu": "stm32l073rz", + "mcu": "stm32l072rz", "variant": "MPPT-1210-HUS" }, "debug": { "default_tools": [ "stlink" ], - "jlink_device": "STM32L073RZ", + "jlink_device": "STM32L072RZ", "onboard_tools": [ "stlink" ], diff --git a/boards/pwm_2420_lus.json b/boards/pwm_2420_lus.json index 0749bca..93daa48 100644 --- a/boards/pwm_2420_lus.json +++ b/boards/pwm_2420_lus.json @@ -1,19 +1,19 @@ { "build": { "cpu": "cortex-m0plus", - "extra_flags": "-DSTM32L073xx", + "extra_flags": "-DSTM32L072xx", "f_cpu": "32000000L", "framework_extra_flags": { "arduino": "-D__CORTEX_SC=0" }, - "mcu": "stm32l073rz", + "mcu": "stm32l072rz", "variant": "PWM-2420-LUS" }, "debug": { "default_tools": [ "stlink" ], - "jlink_device": "STM32L073RZ", + "jlink_device": "STM32L072RZ", "onboard_tools": [ "stlink" ], diff --git a/platformio.ini b/platformio.ini index e5ea6bb..54ee575 100644 --- a/platformio.ini +++ b/platformio.ini @@ -78,7 +78,7 @@ board = pwm_2420_lus board = pwm_2420_lus build_flags = ${env.build_flags} -D BOOTLOADER_ENABLED - -Wl,-T'"$PROJECT_DIR/boards/STM32L073XZ.ld.link_script.ld"',-v + -Wl,-T'"$PROJECT_DIR/boards/STM32L072XZ.ld.link_script.ld"',-v [env:unit_test] platform = native diff --git a/src/mcu.h b/src/mcu.h index 1098530..0219c4e 100644 --- a/src/mcu.h +++ b/src/mcu.h @@ -9,9 +9,9 @@ // mbed defines STM32Fxx variables automatically, so we define them also for Zephyr -#ifdef CONFIG_SOC_STM32L073XX +#ifdef CONFIG_SOC_STM32L072XX #define STM32L0 -#define STM32L073 +#define STM32L072 #endif #ifdef CONFIG_SOC_STM32F072XB @@ -24,8 +24,8 @@ #define STM32G431 #endif -#ifdef STM32L073 -#include "stm32l073xx.h" +#ifdef STM32L072 +#include "stm32l072xx.h" #endif #ifdef STM32F072 diff --git a/src/pwm_switch_driver.c b/src/pwm_switch_driver.c index e58347c..4796c3c 100644 --- a/src/pwm_switch_driver.c +++ b/src/pwm_switch_driver.c @@ -18,8 +18,8 @@ #include "debug.h" #include "helper.h" -#ifdef CONFIG_SOC_STM32L073XX -#include "stm32l073xx.h" +#ifdef CONFIG_SOC_STM32L072XX +#include "stm32l072xx.h" #endif #ifdef CONFIG_SOC_STM32G431XX