Skip to content

Commit f74a776

Browse files
Merge pull request #12 from EmbeddedKitOrg/develop/nn
Develop/nn
2 parents f83526c + 5f35a45 commit f74a776

161 files changed

Lines changed: 419 additions & 197788 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ jobs:
4949
cmake -B build -G Ninja \
5050
-DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake" \
5151
-DCMAKE_BUILD_TYPE=Debug \
52-
-DLINKER_SCRIPT="L1_MCU/STM32F429ZIT6_GCC/stm32f429zit6_flash.ld" \
53-
-DMCU_MODEL="STM32F429ZIT6_GCC"\
52+
-DMCU_MODEL="STM32F429ZIT6_GCC" \
5453
-DUSE_FREERTOS=${{ matrix.config.freertos }} \
5554
-DUSE_FATFS=OFF \
5655
-DUSE_LVGL=${{ matrix.config.lvgl }}
@@ -96,12 +95,10 @@ jobs:
9695
cmake -B build -G Ninja `
9796
-DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake" `
9897
-DCMAKE_BUILD_TYPE=Debug `
99-
-DLINKER_SCRIPT="L1_MCU/STM32F429ZIT6_GCC/stm32f429zit6_flash.ld" `
10098
-DMCU_MODEL="STM32F429ZIT6_GCC" `
10199
-DUSE_FREERTOS=${{ matrix.config.freertos }} `
102100
-DUSE_FATFS=OFF `
103-
-DUSE_LVGL=${{ matrix.config.lvgl }} `
104-
-DUSE_LVGL_THORVG=${{ matrix.config.thorvg }}
101+
-DUSE_LVGL=${{ matrix.config.lvgl }}
105102
ninja -C build
106103
107104
test:

‎CMakeLists.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${CMAKE_PROJE
6363
# 添加子目录
6464
add_subdirectory(L0_Assets)
6565
add_subdirectory(L1_MCU)
66+
# L1_MCU 子目录已生成链接脚本并更新了 LINKER_SCRIPT,在此应用
67+
target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-T${LINKER_SCRIPT}")
6668
add_subdirectory(L2_Core)
6769
add_subdirectory(L3_Middlewares)
6870
add_subdirectory(L4_Components)

‎L1_MCU/CMakeLists.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${MCU_MODEL}")
1818
endif()
1919

2020
add_subdirectory(${MCU_MODEL})
21+
22+
# MCU 子目录通过 PARENT_SCOPE 设置了内存参数,生成链接脚本
23+
include(EkLinkerScript)
24+
ek_configure_linker_script()
25+
26+
# 用生成的链接脚本覆盖工具链文件设置的默认值
27+
set(LINKER_SCRIPT "${EK_GENERATED_LINKER_SCRIPT}"
28+
CACHE FILEPATH "The path to the linker script" FORCE)

‎L1_MCU/GD32F470ZGT6/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ target_compile_definitions(l1_mcu PUBLIC
3636
GD32F470
3737
$<$<CONFIG:Debug>:DEBUG>
3838
)
39+
40+
# 链接脚本内存参数
41+
set(EK_FLASH_ORIGIN "0x08000000" PARENT_SCOPE)
42+
set(EK_FLASH_LENGTH "1024K" PARENT_SCOPE)
43+
set(EK_RAM_ORIGIN "0x20000000" PARENT_SCOPE)
44+
set(EK_RAM_LENGTH "448K" PARENT_SCOPE)
45+
set(EK_CCMRAM_ORIGIN "0x10000000" PARENT_SCOPE)
46+
set(EK_CCMRAM_LENGTH "64K" PARENT_SCOPE)
47+
set(EK_SDRAM1_ORIGIN "0xC0000000" PARENT_SCOPE)
48+
set(EK_SDRAM1_LENGTH "32M" PARENT_SCOPE)

‎L1_MCU/GD32F470ZGT6/gd32f470zgt6_flash.ld‎

Lines changed: 0 additions & 198 deletions
This file was deleted.

‎L1_MCU/STM32F429ZIT6_GCC/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,13 @@ target_compile_definitions(l1_mcu PUBLIC
3232
STM32F429xx
3333
$<$<CONFIG:Debug>:DEBUG>
3434
)
35+
36+
# 链接脚本内存参数
37+
set(EK_FLASH_ORIGIN "0x08000000" PARENT_SCOPE)
38+
set(EK_FLASH_LENGTH "2048K" PARENT_SCOPE)
39+
set(EK_RAM_ORIGIN "0x20000000" PARENT_SCOPE)
40+
set(EK_RAM_LENGTH "192K" PARENT_SCOPE)
41+
set(EK_CCMRAM_ORIGIN "0x10000000" PARENT_SCOPE)
42+
set(EK_CCMRAM_LENGTH "64K" PARENT_SCOPE)
43+
set(EK_SDRAM1_ORIGIN "0xD0000000" PARENT_SCOPE)
44+
set(EK_SDRAM1_LENGTH "8M" PARENT_SCOPE)

0 commit comments

Comments
 (0)