diff --git a/README.md b/README.md index c3716511f4d13f0d4fccb6754367880cfbdc7a87..f92d716c2873ee672ce2de0e8c17c8368a98027e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ RT-Thread supports many architectures, and has covered the major architectures i - **ARM Cortex-M0/M0+**:manufacturers like ST - **ARM Cortex-M3**:manufacturers like ST、Winner Micro、MindMotion, ect. -- **ARM Cortex-M4**:manufacturers like ST、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro, ect. +- **ARM Cortex-M4**:manufacturers like ST、Infineon、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro, ect. - **ARM Cortex-M7**:manufacturers like ST、NXP - **ARM Cortex-M23**:manufacturers like GigaDevice - **ARM Cortex-M33**:manufacturers like ST diff --git a/README_de.md b/README_de.md index b4e2ad86ebed47d8e9805fd2fe1393b0ffda946d..bc3b350ae61e4e3fb70cab5c9bb1af282692000e 100644 --- a/README_de.md +++ b/README_de.md @@ -72,7 +72,7 @@ RT-Thread unterstützt viele Architekturen und hat die wichtigsten Architekturen - **ARM Cortex-M0/M0+**:manufacturers like ST - **ARM Cortex-M3**:manufacturers like ST、Winner Micro、MindMotion, ect. -- **ARM Cortex-M4**:manufacturers like ST、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro, ect. +- **ARM Cortex-M4**:manufacturers like ST、Infineon、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro, ect. - **ARM Cortex-M7**:manufacturers like ST、NXP - **ARM Cortex-M23**:manufacturers like GigaDevice - **ARM Cortex-M33**:manufacturers like ST diff --git a/README_es.md b/README_es.md index 57ab4d4c367b7ebb959b42518388c47f79b9c8c8..78db28576478810852d7c8f498ea5d43b23e5cea 100644 --- a/README_es.md +++ b/README_es.md @@ -72,7 +72,7 @@ RT-Thread es compatible con muchas arquitecturas, y ha cubierto las principales - **ARM Cortex-M0/M0+**:manufacturers like ST - **ARM Cortex-M3**:manufacturers like ST、Winner Micro、MindMotion, ect. -- **ARM Cortex-M4**:manufacturers like ST、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro, ect. +- **ARM Cortex-M4**:manufacturers like ST、Infineon、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro, ect. - **ARM Cortex-M7**:manufacturers like ST、NXP - **ARM Cortex-M23**:manufacturers like GigaDevice - **ARM Cortex-M33**:manufacturers like ST diff --git a/README_zh.md b/README_zh.md index 1d5bec7af75ae7ac69a5e04dde7debd7595c3d96..3d01d009e637295d05a885b5068397ba8a0c5267 100644 --- a/README_zh.md +++ b/README_zh.md @@ -83,7 +83,7 @@ RT-Thread RTOS 支持许多架构,并且已经涵盖了当前应用中的主 - ARM Cortex-M0/M0+:如芯片制造商 ST - ARM Cortex-M3:如芯片制造商 ST、全志、灵动等. -- ARM Cortex-M4:如芯片制造商 ST、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro等 +- ARM Cortex-M4:如芯片制造商 ST、Infineon、Nuvoton、NXP、[Nordic](https://github.com/RT-Thread/rt-thread/tree/master/bsp/nrf5x)、GigaDevice、Realtek、Ambiq Micro等 - ARM Cortex-M7:如芯片制造商 ST、NXP - ARM Cortex-M23:如芯片制造商 GigaDevice - ARM Cortex-M33:如芯片制造商 ST diff --git "a/bsp/Infineon/docs/PSOC6\347\263\273\345\210\227BSP\345\210\266\344\275\234\346\225\231\347\250\213.md" "b/bsp/Infineon/docs/PSOC6\347\263\273\345\210\227BSP\345\210\266\344\275\234\346\225\231\347\250\213.md" index d234b6485f4c7c5f063c48831a50fbb929fbe670..2b9478ad4ba191a70eb8146306d7d539a0d8fe7e 100644 --- "a/bsp/Infineon/docs/PSOC6\347\263\273\345\210\227BSP\345\210\266\344\275\234\346\225\231\347\250\213.md" +++ "b/bsp/Infineon/docs/PSOC6\347\263\273\345\210\227BSP\345\210\266\344\275\234\346\225\231\347\250\213.md" @@ -79,7 +79,7 @@ BSP 的制作过程分为如下四个步骤: #### 3.2.1 堆内存配置讲解 -通常情况下,系统 RAM 中的一部分内存空间会被用作堆内存。下面代码的作用是,在不同编译器下规定堆内存的起始地址 **HEAP_BEGIN** 和结束地址 **HEAP_END**。这里 **HEAP_BEGIN** 和 **HEAP_END** 的值需要和后面 [3.4.1 修改链接脚本](# 3.4.1 修改链接脚本) 章节所修改的配置相一致。 +通常情况下,系统 RAM 中的一部分内存空间会被用作堆内存。下面代码的作用是,在不同编译器下规定堆内存的起始地址 **HEAP_BEGIN** 和结束地址 **HEAP_END**。这里 **HEAP_BEGIN** 和 **HEAP_END** 的值需要和后面 [3.5.1 修改链接脚本](# 3.5.1 修改链接脚本) 章节所修改的配置相一致。 在某些系列的芯片中,芯片 RAM 可能分布在不连续的多块内存区域上。此时堆内存的位置可以和系统内存在同一片连续的内存区域,也可以存放在一片独立的内存区域中。 @@ -103,16 +103,52 @@ BSP 的制作过程分为如下四个步骤: ![](./figures/Kconfig.png) -### 3.4 修改工程构建相关文件 +### 3.4 添加外设相关文件 + +#### 3.4.1 添加底层外设库 + +![](./figures/hal_config1.png) + +接下来为 BSP 添加底层外设库文件,下图的文件是从 Modus 生成的文件中拷贝而来。 + +![](./figures/hal_config2.png) + +源库文件路径如下图: + +![](./figures/hal_config3.png) + +同时拷贝 **TARGET_CY8CKIT-062S2-43012** 文件(需根据不同芯片型号拷贝不同名称的文件夹),该文件夹路径如下: + +![](./figures/hal_config4.png) + +#### 3.4.1 修改外设配置脚本 + +![](./figures/hal_config5.png) + +![](./figures/hal_config6.png) + +![](./figures/hal_config7.png) + +### 3.5 修改工程构建相关文件 接下来需要修改用于构建工程相关的文件。 -#### 3.4.1 修改链接脚本 +#### 3.5.1 修改链接脚本 **linker_scripts** 链接文件如下图所示: ![](./figures/linker_scripts.png) +**linker_scripts** 链接文件是从 Modus 生成的示例工程中拷贝而来,需要修改其名称为 link.ld/.icf/.sct ,源文件路径如下: + +ARMCC/ARMClang 使用: + +![](./figures/linker_scripts2.png) + +GCC 使用: + +![](./figures/linker_scripts1.png) + 下面以 MDK 使用的链接脚本 link.sct 为例,演示如何修改链接脚本: ![](./figures/linkscripts_change.png) @@ -125,7 +161,7 @@ BSP 的制作过程分为如下四个步骤: ![](./figures/link_lds.png) -#### 3.4.2 修改构建脚本 +#### 3.5.2 修改构建脚本 **SConscript** 脚本决定 MDK/IAR/RT-Thread Studio 工程的生成以及编译过程中要添加文件。 @@ -133,13 +169,13 @@ BSP 的制作过程分为如下四个步骤: ![](./figures/SConscript.png) -#### 3.4.3 修改编译选项 +#### 3.5.3 修改编译选项 rtconfig.py 用于选择编译工具链,可以自行在 CROSS_TOOL 后面选择修改编译工程所需要的工具链,目前 PSCOC6 支持 gcc 和 armclang。 ![](./figures/rt_configpy.png) -#### 3.4.4 修改工程模板 +#### 3.5.4 修改工程模板 **template** 文件是生成 MDK/IAR 工程的模板文件,通过修改该文件可以设置工程中使用的芯片型号以及下载方式。MDK4/MDK5/IAR 的工程模板文件,如下图所示: @@ -181,7 +217,31 @@ RT-Thread Settings 中硬件相关配置是在 board/Kconfig 中描述的。移 ![](./figures/studio5.png) -#### 3.5.1 重新生成 rtconfig.h 文件 +首先打开 RT-Thread Studio ,在 IDE 的左上角点击 `文件—>导入—>RT-Thread Bsp 到工作空间中` + +![](./figures/studio1.png) + +![](./figures/studio2.png) + +导入成功后,文件资源管理器窗口中会显示如下结构,其中 RT-Thread Settings 为图形化工程配置文件,双击打开即可。 + +![](./figures/studio3.png) + +RT-Thread Settings 中硬件相关配置是在 board/Kconfig 中描述的。移植过程如需添加/修改配置,请修改此文件。 + +![](./figures/studio4.png) + +### 3.6 重新生成工程 + +* MDK5 :重新生成工程需要使用 Env 工具。 + +* RT-Thread Studio:使用 Env 工具/同步 scons 配置至项目 + +同步 scons 配置至项目: + +![](./figures/studio5.png) + +#### 3.6.1 重新生成 rtconfig.h 文件 **MDK5:** @@ -197,6 +257,10 @@ RT-Thread Settings 中硬件相关配置是在 board/Kconfig 中描述的。移 使用上述方法/点击同步 scons 配置至项目 +#### 3.6.2 重新生成 MDK 工程 + +使用上述方法/点击同步 scons 配置至项目 + #### 3.5.2 重新生成 MDK 工程 以重新生成 MDK 工程为例,介绍如何重新生成 BSP 工程。 diff --git a/bsp/Infineon/docs/figures/hal_config1.png b/bsp/Infineon/docs/figures/hal_config1.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf75dc9bf181859b23ce2267b1b53c638210d3a Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config1.png differ diff --git a/bsp/Infineon/docs/figures/hal_config2.png b/bsp/Infineon/docs/figures/hal_config2.png new file mode 100644 index 0000000000000000000000000000000000000000..1ab6885db0aebd7f9885104b4f0cf7c3c3494afd Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config2.png differ diff --git a/bsp/Infineon/docs/figures/hal_config3.png b/bsp/Infineon/docs/figures/hal_config3.png new file mode 100644 index 0000000000000000000000000000000000000000..9ff61e4782ed1ba6ebd4fc70e2ce5b91a9bf3caf Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config3.png differ diff --git a/bsp/Infineon/docs/figures/hal_config4.png b/bsp/Infineon/docs/figures/hal_config4.png new file mode 100644 index 0000000000000000000000000000000000000000..d511749fe4633f11f49631c7e5c7b0c94a8c2739 Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config4.png differ diff --git a/bsp/Infineon/docs/figures/hal_config5.png b/bsp/Infineon/docs/figures/hal_config5.png new file mode 100644 index 0000000000000000000000000000000000000000..0ee68ef998373d96adef8ccf9c6f7e559cadd148 Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config5.png differ diff --git a/bsp/Infineon/docs/figures/hal_config6.png b/bsp/Infineon/docs/figures/hal_config6.png new file mode 100644 index 0000000000000000000000000000000000000000..703c5047cce1a98463f67fd2000565e730f625aa Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config6.png differ diff --git a/bsp/Infineon/docs/figures/hal_config7.png b/bsp/Infineon/docs/figures/hal_config7.png new file mode 100644 index 0000000000000000000000000000000000000000..53c6e046289cdaf09add9ffcb6e8d16b11edaa6c Binary files /dev/null and b/bsp/Infineon/docs/figures/hal_config7.png differ diff --git a/bsp/Infineon/docs/figures/linker_scripts1.png b/bsp/Infineon/docs/figures/linker_scripts1.png new file mode 100644 index 0000000000000000000000000000000000000000..7437ae20bf8a4dbd553fcaf2a332de8d83635da6 Binary files /dev/null and b/bsp/Infineon/docs/figures/linker_scripts1.png differ diff --git a/bsp/Infineon/docs/figures/linker_scripts2.png b/bsp/Infineon/docs/figures/linker_scripts2.png new file mode 100644 index 0000000000000000000000000000000000000000..97c7645db9325fa3c03712e37ccfb2e7490a20ee Binary files /dev/null and b/bsp/Infineon/docs/figures/linker_scripts2.png differ