Fix board files for Zephyr 2.2 compatibility
Warning: These changes break compatibility with previous v2.1.
This commit is contained in:
@@ -48,6 +48,8 @@ After that, you should be able to compile and flash Zephyr for supported boards
|
||||
|
||||
As the build system in PlatformIO is not the same as the native Zephyr build system, there might still be some issues. Generally, also `west build` and `west flash` should work if called from within the zephyr subdirectory.
|
||||
|
||||
**Important:** For the STM32G4 we require several bug fixes that were introduced in Zephyr v2.2. The PlatformIO package is currently based on v2.1, so it is required to use native Zephyr build system until PlatformIO package is updated.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### Errors with STM32L072 MCU using OpenOCD
|
||||
|
||||
@@ -21,23 +21,23 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
gnd {
|
||||
gpios = <&gpiob 14 GPIO_INT_ACTIVE_LOW>;
|
||||
gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED GND";
|
||||
};
|
||||
soc12 {
|
||||
gpios = <&gpiob 13 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED SOC12";
|
||||
};
|
||||
soc3 {
|
||||
gpios = <&gpiob 2 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED SOC3";
|
||||
};
|
||||
rxtx {
|
||||
gpios = <&gpiob 11 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 11 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED RXTX";
|
||||
};
|
||||
load {
|
||||
gpios = <&gpiob 10 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 10 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED Load";
|
||||
};
|
||||
};
|
||||
@@ -45,11 +45,11 @@
|
||||
switches {
|
||||
compatible = "switch";
|
||||
load-en {
|
||||
gpios = <&gpiob 12 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 12 GPIO_ACTIVE_HIGH>;
|
||||
label = "Load enable";
|
||||
};
|
||||
usb-en {
|
||||
gpios = <&gpiob 12 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 12 GPIO_ACTIVE_HIGH>;
|
||||
label = "USB charging port enable";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Zephyr Kernel Configuration
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SOC_SERIES_STM32L0X=y
|
||||
|
||||
# Platform Configuration
|
||||
CONFIG_SOC_STM32L073XX=y
|
||||
|
||||
# General Kernel Options
|
||||
@@ -14,7 +10,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
|
||||
# Serial Drivers
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||
# enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
a {
|
||||
gpios = <&gpiob 13 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED pin A";
|
||||
};
|
||||
b {
|
||||
gpios = <&gpiob 14 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED pin B";
|
||||
};
|
||||
c {
|
||||
gpios = <&gpiob 2 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED pin C";
|
||||
};
|
||||
};
|
||||
@@ -37,19 +37,19 @@
|
||||
switches {
|
||||
compatible = "switch";
|
||||
load-en {
|
||||
gpios = <&gpioc 13 GPIO_DIR_IN>;
|
||||
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
|
||||
label = "Load enable";
|
||||
};
|
||||
usb-pwr-en {
|
||||
gpios = <&gpiob 10 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 10 GPIO_ACTIVE_HIGH>;
|
||||
label = "USB charging port enable";
|
||||
};
|
||||
v-solar-en {
|
||||
gpios = <&gpioc 14 GPIO_DIR_IN>;
|
||||
gpios = <&gpioc 14 GPIO_ACTIVE_HIGH>;
|
||||
label = "Solar voltage measurement enable";
|
||||
};
|
||||
boot0-en {
|
||||
gpios = <&gpiob 12 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 12 GPIO_ACTIVE_HIGH>;
|
||||
label = "BOOT0 pin trigger";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Zephyr Kernel Configuration
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SOC_SERIES_STM32L0X=y
|
||||
|
||||
# Platform Configuration
|
||||
CONFIG_SOC_STM32L073XX=y
|
||||
|
||||
# General Kernel Options
|
||||
@@ -14,7 +10,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
|
||||
# Serial Drivers
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||
# enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pwr {
|
||||
gpios = <&gpioc 15 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpioc 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Power LED";
|
||||
};
|
||||
};
|
||||
@@ -60,7 +60,7 @@
|
||||
switches {
|
||||
compatible = "switch";
|
||||
load-dis {
|
||||
gpios = <&gpiob 15 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "Load disable";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SOC_SERIES_STM32G4X=y
|
||||
CONFIG_SOC_STM32G431XX=y
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pwr {
|
||||
gpios = <&gpiob 14 GPIO_INT_ACTIVE_LOW>;
|
||||
gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED GND";
|
||||
};
|
||||
load {
|
||||
gpios = <&gpiob 15 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED Load";
|
||||
};
|
||||
};
|
||||
@@ -33,15 +33,15 @@
|
||||
switches {
|
||||
compatible = "switch";
|
||||
load-dis {
|
||||
gpios = <&gpiob 2 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
|
||||
label = "Load disable";
|
||||
};
|
||||
uext-dis {
|
||||
gpios = <&gpioc 14 GPIO_DIR_IN>;
|
||||
gpios = <&gpioc 14 GPIO_ACTIVE_HIGH>;
|
||||
label = "UEXT disable";
|
||||
};
|
||||
can-dis {
|
||||
gpios = <&gpioa 15 GPIO_DIR_IN>;
|
||||
gpios = <&gpioa 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "CAN disable / standby";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Zephyr Kernel Configuration
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SOC_SERIES_STM32F0X=y
|
||||
|
||||
# Platform Configuration
|
||||
CONFIG_SOC_STM32F072XB=y
|
||||
|
||||
# General Kernel Options
|
||||
@@ -13,7 +9,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
|
||||
# Serial Drivers
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||
# enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
a {
|
||||
gpios = <&gpiob 13 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED pin A";
|
||||
};
|
||||
b {
|
||||
gpios = <&gpiob 14 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED pin B";
|
||||
};
|
||||
c {
|
||||
gpios = <&gpiob 15 GPIO_INT_ACTIVE_HIGH>;
|
||||
gpios = <&gpiob 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "LED pin C";
|
||||
};
|
||||
};
|
||||
@@ -37,15 +37,15 @@
|
||||
switches {
|
||||
compatible = "switch";
|
||||
load-dis {
|
||||
gpios = <&gpiob 2 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
|
||||
label = "Load disable";
|
||||
};
|
||||
usb-pwr-dis {
|
||||
gpios = <&gpiob 5 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>;
|
||||
label = "USB charging port disable";
|
||||
};
|
||||
boot0-en {
|
||||
gpios = <&gpiob 12 GPIO_DIR_IN>;
|
||||
gpios = <&gpiob 12 GPIO_ACTIVE_HIGH>;
|
||||
label = "BOOT0 pin trigger";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Zephyr Kernel Configuration
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SOC_SERIES_STM32L0X=y
|
||||
|
||||
# Platform Configuration
|
||||
CONFIG_SOC_STM32L073XX=y
|
||||
|
||||
# General Kernel Options
|
||||
@@ -14,7 +10,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
|
||||
# Serial Drivers
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||
# enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
|
||||
+8
-1
@@ -9,7 +9,14 @@
|
||||
#include <algorithm>
|
||||
|
||||
// necessary for PlatformIO debug session
|
||||
void std::__throw_bad_alloc() {
|
||||
void std::__throw_bad_alloc()
|
||||
{
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
// necessary to compile Zephyr v2.2
|
||||
void std::__throw_length_error(char const*)
|
||||
{
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
# Copyright (c) 2020 Martin Jäger / Libre Solar
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
title: GPIO switch parent node
|
||||
description: GPIO pins to switch something on or off
|
||||
|
||||
compatible: "switch"
|
||||
|
||||
child-binding:
|
||||
title: GPIO switch child node
|
||||
description: GPIO switch child node
|
||||
properties:
|
||||
gpios:
|
||||
|
||||
Reference in New Issue
Block a user