feat(stm32): add GPIO and EXTI device model drivers

Add device-tree GPIO/EXTI controllers, built-in DTB support for GCC and ArmClang, and BSP integration for STM32F407 RT-Spark and STM32H750 ART-Pi. Document how BSP users enable the DM drivers.
This commit is contained in:
Rbb666 authored and Rbb666 committed 2026-08-12 12:54:50 +08:00
1 parent 6b4f34204e
commit 655aea948e
24 files changed
+1456 -7

No files matched your search

@@ -11,7 +11,10 @@ src = []
src += ['drv_dma.c']
path = [cwd]
if GetDepend(['RT_USING_PIN']):
if GetDepend(['RT_USING_DM']):
group += SConscript(os.path.join('dm', 'SConscript'))
elif GetDepend(['RT_USING_PIN']):
src += ['drv_gpio.c']
if GetDepend(['RT_USING_SERIAL']):
@@ -137,6 +140,6 @@ path += [os.path.join(cwd, 'config')]
if GetDepend('BSP_USING_ON_CHIP_FLASH'):
path += [os.path.join(cwd, 'drv_flash')]
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
group += DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
@@ -0,0 +1,30 @@
Import('RTT_ROOT')
Import('rtconfig')
from building import *
import os
cwd = GetCurrentDir()
parent = os.path.dirname(cwd)
src = ['drv_exti.c']
if GetDepend(['BSP_USING_GPIO']):
src += ['drv_gpio.c']
path = [
cwd,
parent,
os.path.join(parent, 'config'),
os.path.join(RTT_ROOT, 'components', 'drivers', 'pin'),
]
group = []
group += DefineGroup('STM32 DM Drivers', src,
depend = ['RT_USING_DM'],
CPPPATH = path)
if rtconfig.PLATFORM == 'armclang':
group += DefineGroup('STM32 DM FDT', ['builtin_fdt_ac6.c'],
depend = ['RT_USING_BUILTIN_FDT'], CPPPATH = [cwd])
Return('group')
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2006-2026, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <rtconfig.h>
#define FDT_STRINGIFY_(value) #value
#define FDT_STRINGIFY(value) FDT_STRINGIFY_(value)
#ifdef RT_BUILTIN_FDT_PATH
__asm(
".section .rodata.dtb, \"a\", %progbits\n"
".balign 8\n"
".global rt_hw_builtin_fdt\n"
".type rt_hw_builtin_fdt, %object\n"
"rt_hw_builtin_fdt:\n"
".incbin " FDT_STRINGIFY(RT_BUILTIN_FDT_PATH) "\n"
".size rt_hw_builtin_fdt, . - rt_hw_builtin_fdt\n");
#endif
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2006-2026, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <rtconfig.h>
.section .rodata.dtb, "a", %progbits
.balign 8
.global rt_hw_builtin_fdt
.type rt_hw_builtin_fdt, %object
rt_hw_builtin_fdt:
#ifdef RT_BUILTIN_FDT_PATH
.incbin RT_BUILTIN_FDT_PATH
#endif
.size rt_hw_builtin_fdt, . - rt_hw_builtin_fdt
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2006-2026, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __DRV_EXTI_H__
#define __DRV_EXTI_H__
#include <rtthread.h>
#include <board.h>
#include <drivers/ofw.h>
struct stm32_exti;
struct stm32_exti *stm32_exti_get(struct rt_ofw_node *np);
int stm32_exti_acquire(struct stm32_exti *exti, GPIO_TypeDef *gpio,
rt_base_t pin, rt_uint32_t irq_mode);
rt_err_t stm32_exti_release(struct stm32_exti *exti, GPIO_TypeDef *gpio,
rt_base_t pin);
#endif /* __DRV_EXTI_H__ */
File diff suppressed because it is too large. Load diff
@@ -21,6 +21,8 @@
extern "C" {
#endif
#ifndef RT_USING_DM
#define __STM32_PORT(port) GPIO##port##_BASE
/**
@@ -80,6 +82,8 @@ extern "C" {
#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__STM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
#endif
#endif /* !RT_USING_DM */
struct pin_irq_map
{
rt_uint16_t pinbit;
+26 -2
View File
@@ -11,7 +11,14 @@
#include "drv_common.h"
#include <board.h>
#ifdef RT_USING_PIN
#ifdef RT_USING_BUILTIN_FDT
#include <drivers/ofw_fdt.h>
#include <drivers/pic.h>
extern const unsigned char rt_hw_builtin_fdt[];
#endif
#if defined(RT_USING_PIN) && !defined(RT_USING_DM)
#include <drv_gpio.h>
#endif
@@ -196,7 +203,24 @@ rt_weak void rt_hw_board_init(void)
rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif
#ifdef RT_USING_PIN
#ifdef RT_USING_BUILTIN_FDT
if (rt_fdt_prefetch((void *)rt_hw_builtin_fdt) != RT_EOK ||
rt_fdt_unflatten() != RT_EOK)
{
LOG_E("Builtin FDT initialization failed");
RT_ASSERT(0);
}
#ifdef RT_USING_PIC
if (rt_pic_init() != RT_EOK || rt_pic_irq_init() != RT_EOK)
{
LOG_E("PIC initialization failed");
RT_ASSERT(0);
}
#endif
#endif
#if defined(RT_USING_PIN) && !defined(RT_USING_DM)
rt_hw_pin_init();
#endif
+10
View File
@@ -11,13 +11,23 @@ config SOC_STM32F407ZG
select SOC_SERIES_STM32F4
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
select RT_USING_OFW if RT_USING_DM
select RT_USING_BUILTIN_FDT if RT_USING_DM
select RT_USING_PIC if RT_USING_DM
select RT_PIC_ARM_NVIC if RT_USING_DM
select RT_USING_PIN if RT_USING_DM
default y
config BOARD_STM32F407_SPARK
bool
default y
config RT_BUILTIN_FDT_PATH
string
default "board/dts/stm32f407-rt-spark.dtb" if RT_USING_DM
source "$(RTT_DIR)/Kconfig"
osource "$PKGS_DIR/Kconfig"
rsource "../libraries/Kconfig"
+10
View File
@@ -113,6 +113,16 @@ msh >
本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。
### 启用设备模型(DM)
本 BSP 通过 `RT_USING_DM` 在设备模型驱动和传统 BSP 驱动之间进行选择。启用 DM 后,GPIO 和 EXTI 使用设备树描述,传统的 STM32 GPIO 驱动不会参与构建。
1. 在当前 BSP 目录执行 `scons --menuconfig`。
2. 进入 `Device Drivers`,选中 `Enable device driver model with device tree`。
3. 保存配置后执行 `scons -jN` 构建 GCC 工程。
BSP 会随 `RT_USING_DM` 自动选择 OFW、内置 FDT、PIC、NVIC 和 PIN 框架,并使用 `board/dts/stm32f407-rt-spark.dts`。构建过程会生成并嵌入 DTB。
## 注意事项
暂无
+10
View File
@@ -113,6 +113,16 @@ This BSP only enables GPIO and Serial1 by default. If you want to use more advan
For a more detailed description of this chapter, please refer to [STM32 Series BSP Peripheral Driver Tutorial](... /docs/STM32 Series BSP Peripheral Driver Tutorial.md).
### Enabling the Device Model (DM)
This BSP uses `RT_USING_DM` to select either the device-model drivers or the legacy BSP drivers. When DM is enabled, GPIO and EXTI are described by the device tree and the legacy STM32 GPIO driver is excluded from the build.
1. Run `scons --menuconfig` in this BSP directory.
2. Open `Device Drivers` and enable `Enable device driver model with device tree`.
3. Save the configuration and run `scons -jN` for a GCC build.
The BSP automatically selects OFW, built-in FDT, PIC, NVIC, and PIN support with `RT_USING_DM`, and uses `board/dts/stm32f407-rt-spark.dts`. The build converts and embeds the DTB automatically.
## Notes
Not available at this time
+22
View File
@@ -10,6 +10,7 @@ else:
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
try:
from building import *
import dtc
except:
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
print(RTT_ROOT)
@@ -65,6 +66,27 @@ else:
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
if GetDepend('RT_USING_BUILTIN_FDT'):
if os.getenv('DTC_PATH'):
os.environ['PATH'] = os.path.dirname(os.getenv('DTC_PATH')) + \
os.pathsep + os.environ['PATH']
dtb_name = GetDepend('RT_BUILTIN_FDT_PATH').strip('"')
dts_name = os.path.splitext(dtb_name)[0] + '.dts'
dts_path = os.path.join(SDK_ROOT, dts_name)
dtc.dts_to_dtb(RTT_ROOT, [dts_name],
include_paths=[os.path.dirname(dts_path)])
if rtconfig.PLATFORM == 'gcc':
dtb_path = os.path.join(SDK_ROOT, dtb_name)
fdt_source = os.path.join(libraries_path_prefix, 'HAL_Drivers',
'drivers', 'dm', 'builtin_fdt_gcc.S')
fdt_object = env.Object(
target=os.path.join(SDK_ROOT, 'build', 'dts', 'builtin_fdt_gcc.o'),
source=fdt_source)
env.Depends(fdt_object, dtb_path)
objs += fdt_object
rtconfig.BSP_LIBRARY_TYPE = None
# include drivers
@@ -16,10 +16,14 @@
#include <rtdevice.h>
#endif /* RT_USING_NANO */
#ifndef RT_USING_DM
#define GPIO_LED_B GET_PIN(F, 11)
#define GPIO_LED_R GET_PIN(F, 12)
#endif
int main(void)
{
#ifndef RT_USING_DM
rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT);
while (1)
@@ -29,4 +33,10 @@ int main(void)
rt_pin_write(GPIO_LED_R, PIN_LOW);
rt_thread_mdelay(500);
}
#else
while (1)
{
rt_thread_mdelay(1000);
}
#endif
}
@@ -0,0 +1,131 @@
/dts-v1/;
#include <dt-bindings/pin/pin.h>
/ {
compatible = "st,stm32f407zg", "st,stm32f4";
model = "RT-Thread STM32F407 RT-Spark";
#address-cells = <1>;
#size-cells = <1>;
aliases {
};
chosen {
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-m4";
device_type = "cpu";
reg = <0>;
};
};
soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
interrupt-parent = <&nvic>;
nvic: interrupt-controller@e000e100 {
compatible = "arm,v7m-nvic";
reg = <0xe000e100 0xc00>;
interrupt-controller;
#interrupt-cells = <2>;
arm,num-irqs = <82>;
arm,num-irq-priority-bits = <4>;
};
exti: interrupt-controller@40013c00 {
compatible = "st,stm32-exti";
reg = <0x40013c00 0x400>;
interrupt-controller;
#interrupt-cells = <1>;
#address-cells = <0>;
num-lines = <32>;
interrupts = <6 5>, <7 5>, <8 5>, <9 5>,
<10 5>, <23 5>, <40 5>;
interrupt-names = "line0", "line1", "line2", "line3",
"line4", "line5-9", "line10-15";
line-ranges = <0 1>, <1 1>, <2 1>, <3 1>,
<4 1>, <5 5>, <10 6>;
};
gpioa: gpio@40020000 {
compatible = "st,stm32-gpio";
reg = <0x40020000 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiob: gpio@40020400 {
compatible = "st,stm32-gpio";
reg = <0x40020400 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioc: gpio@40020800 {
compatible = "st,stm32-gpio";
reg = <0x40020800 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiod: gpio@40020c00 {
compatible = "st,stm32-gpio";
reg = <0x40020c00 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioe: gpio@40021000 {
compatible = "st,stm32-gpio";
reg = <0x40021000 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiof: gpio@40021400 {
compatible = "st,stm32-gpio";
reg = <0x40021400 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiog: gpio@40021800 {
compatible = "st,stm32-gpio";
reg = <0x40021800 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioh: gpio@40021c00 {
compatible = "st,stm32-gpio";
reg = <0x40021c00 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioi: gpio@40022000 {
compatible = "st,stm32-gpio";
reg = <0x40022000 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
};
};
@@ -55,6 +55,11 @@ SECTIONS
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
/* section information for Open Firmware registration data */
. = ALIGN(4);
KEEP(*(SORT(.rt_ofw_data.*)))
. = ALIGN(4);
. = ALIGN(4);
PROVIDE(__ctors_start__ = .);
+2
View File
@@ -41,6 +41,7 @@ if PLATFORM == 'gcc':
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
CXX = PREFIX + 'g++'
CPP = PREFIX + 'gcc'
LINK = PREFIX + 'gcc'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
@@ -50,6 +51,7 @@ if PLATFORM == 'gcc':
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
CPPFLAGS = ' -E -P -x assembler-with-cpp'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
CPATH = ''
+10
View File
@@ -12,6 +12,11 @@ config SOC_STM32H750XB
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
select RT_USING_CACHE
select RT_USING_OFW if RT_USING_DM
select RT_USING_BUILTIN_FDT if RT_USING_DM
select RT_USING_PIC if RT_USING_DM
select RT_PIC_ARM_NVIC if RT_USING_DM
select RT_USING_PIN if RT_USING_DM
default y
config BOARD_STM32H750_ARTPI
@@ -19,7 +24,12 @@ config BOARD_STM32H750_ARTPI
select SOC_STM32H750XB
default y
config RT_BUILTIN_FDT_PATH
string
default "board/dts/stm32h750-artpi.dtb" if RT_USING_DM
source "$(RTT_DIR)/Kconfig"
osource "$PKGS_DIR/Kconfig"
rsource "../libraries/Kconfig"
+11 -1
View File
@@ -115,6 +115,16 @@ msh >
本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。
### 启用设备模型(DM)
本 BSP 通过 `RT_USING_DM` 在设备模型驱动和传统 BSP 驱动之间进行选择。启用 DM 后,GPIO 和 EXTI 使用设备树描述,传统的 STM32 GPIO 驱动不会参与构建。
1. 在当前 BSP 目录执行 `scons --menuconfig`。
2. 进入 `Device Drivers`,选中 `Enable device driver model with device tree`。
3. 保存配置后执行 `scons -jN` 构建 GCC 工程。
BSP 会随 `RT_USING_DM` 自动选择 OFW、内置 FDT、PIC、NVIC 和 PIN 框架,并使用 `board/dts/stm32h750-artpi.dts`。构建过程会生成并嵌入 DTB。
## 注意事项
- 调试串口为串口4 映射说明
@@ -143,4 +153,4 @@ RT-Thread [社区论坛](https://club.rt-thread.org/)。
## 贡献代码
如果您对 ART-Pi 感兴趣,并有一些好玩的项目愿意与大家分享,欢迎给我们贡献代码,您可以参考 [ART-Pi 代码贡献手册](https://github.com/RT-Thread-Studio/sdk-bsp-stm32h750-realthread-artpi/blob/master/documents/UM5004-RT-Thread ART-Pi 代码贡献手册.md) 。
如果您对 ART-Pi 感兴趣,并有一些好玩的项目愿意与大家分享,欢迎给我们贡献代码,您可以参考 [ART-Pi 代码贡献手册](https://github.com/RT-Thread-Studio/sdk-bsp-stm32h750-realthread-artpi/blob/master/documents/UM5004-RT-Thread ART-Pi 代码贡献手册.md) 。
+22
View File
@@ -10,6 +10,7 @@ else:
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
try:
from building import *
import dtc
except:
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
print(RTT_ROOT)
@@ -65,6 +66,27 @@ else:
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
if GetDepend('RT_USING_BUILTIN_FDT'):
if os.getenv('DTC_PATH'):
os.environ['PATH'] = os.path.dirname(os.getenv('DTC_PATH')) + \
os.pathsep + os.environ['PATH']
dtb_name = GetDepend('RT_BUILTIN_FDT_PATH').strip('"')
dts_name = os.path.splitext(dtb_name)[0] + '.dts'
dts_path = os.path.join(SDK_ROOT, dts_name)
dtc.dts_to_dtb(RTT_ROOT, [dts_name],
include_paths=[os.path.dirname(dts_path)])
if rtconfig.PLATFORM == 'gcc':
dtb_path = os.path.join(SDK_ROOT, dtb_name)
fdt_source = os.path.join(libraries_path_prefix, 'HAL_Drivers',
'drivers', 'dm', 'builtin_fdt_gcc.S')
fdt_object = env.Object(
target=os.path.join(SDK_ROOT, 'build', 'dts', 'builtin_fdt_gcc.o'),
source=fdt_source)
env.Depends(fdt_object, dtb_path)
objs += fdt_object
rtconfig.BSP_LIBRARY_TYPE = None
# include drivers
+10 -2
View File
@@ -12,7 +12,9 @@
#include <board.h>
/* defined the LED0 pin: PI8 */
#ifndef RT_USING_DM
#define LED0_PIN GET_PIN(I, 8)
#endif
#ifdef RT_USING_WIFI
extern void wlan_autoconnect_init(void);
@@ -20,21 +22,27 @@
int main(void)
{
#ifndef RT_USING_DM
/* set LED0 pin mode to output */
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
#ifdef RT_USING_WIFI
#endif
#ifdef RT_USING_WIFI
/* init Wi-Fi auto connect feature */
wlan_autoconnect_init();
/* enable auto reconnect on WLAN device */
rt_wlan_config_autoreconnect(RT_TRUE);
#endif
#endif
while (1)
{
#ifndef RT_USING_DM
rt_pin_write(LED0_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(LED0_PIN, PIN_LOW);
rt_thread_mdelay(500);
#else
rt_thread_mdelay(1000);
#endif
}
}
@@ -0,0 +1,145 @@
/dts-v1/;
/ {
compatible = "st,stm32h750xb", "st,stm32h7";
model = "RT-Thread STM32H750 ART-Pi";
#address-cells = <1>;
#size-cells = <1>;
aliases {
};
chosen {
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-m7";
device_type = "cpu";
reg = <0>;
};
};
soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
interrupt-parent = <&nvic>;
nvic: interrupt-controller@e000e100 {
compatible = "arm,v7m-nvic";
reg = <0xe000e100 0xc00>;
interrupt-controller;
#interrupt-cells = <2>;
arm,num-irqs = <150>;
arm,num-irq-priority-bits = <4>;
};
exti: interrupt-controller@58000000 {
compatible = "st,stm32-exti";
reg = <0x58000000 0x400>;
interrupt-controller;
#interrupt-cells = <1>;
#address-cells = <0>;
num-lines = <96>;
interrupts = <6 5>, <7 5>, <8 5>, <9 5>,
<10 5>, <23 5>, <40 5>;
interrupt-names = "line0", "line1", "line2", "line3",
"line4", "line5-9", "line10-15";
line-ranges = <0 1>, <1 1>, <2 1>, <3 1>,
<4 1>, <5 5>, <10 6>;
};
gpioa: gpio@58020000 {
compatible = "st,stm32-gpio";
reg = <0x58020000 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiob: gpio@58020400 {
compatible = "st,stm32-gpio";
reg = <0x58020400 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioc: gpio@58020800 {
compatible = "st,stm32-gpio";
reg = <0x58020800 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiod: gpio@58020c00 {
compatible = "st,stm32-gpio";
reg = <0x58020c00 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioe: gpio@58021000 {
compatible = "st,stm32-gpio";
reg = <0x58021000 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiof: gpio@58021400 {
compatible = "st,stm32-gpio";
reg = <0x58021400 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiog: gpio@58021800 {
compatible = "st,stm32-gpio";
reg = <0x58021800 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioh: gpio@58021c00 {
compatible = "st,stm32-gpio";
reg = <0x58021c00 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioi: gpio@58022000 {
compatible = "st,stm32-gpio";
reg = <0x58022000 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpioj: gpio@58022400 {
compatible = "st,stm32-gpio";
reg = <0x58022400 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
gpiok: gpio@58022800 {
compatible = "st,stm32-gpio";
reg = <0x58022800 0x400>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&exti>;
};
};
};
@@ -67,6 +67,11 @@ SECTIONS
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
/* section information for Open Firmware registration data */
. = ALIGN(4);
KEEP(*(SORT(.rt_ofw_data.*)))
. = ALIGN(4);
. = ALIGN(4);
PROVIDE(__ctors_start__ = .);
+2
View File
@@ -37,6 +37,7 @@ if PLATFORM == 'gcc':
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
CXX = PREFIX + 'g++'
CPP = PREFIX + 'gcc'
LINK = PREFIX + 'gcc'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
@@ -46,6 +47,7 @@ if PLATFORM == 'gcc':
DEVICE = ' -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
CPPFLAGS = ' -E -P -x assembler-with-cpp'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
CPATH = ''