stm32f2能够编译通过

This commit is contained in:
zhangzheng
2024-04-10 15:55:07 +00:00
parent 780d4db78d
commit f3de8b8869
12 changed files with 109 additions and 61 deletions

View File

@@ -14,7 +14,7 @@ if (${CONFIG_ARCH} STREQUAL "cortex-m3" OR
" )
set(CORTEX_M_LINK_FLAGS "-pie")
set(LIBC_NAME "mulsc")
set(LIBC_NAME "muslc")
set(ARCH_NAME "armv7_8m")
include_directories(

View File

@@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13)
file(GLOB_RECURSE deps *.c *.S)
if (DEFINED CONFIG_ELF_LAUNCH)
if (CONFIG_ELF_LAUNCH STREQUAL "y")
list(REMOVE_ITEM deps ${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys_util/src/u_app_loader.c)
list(APPEND deps ${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys_util/src/u_elf_loader.c)
endif()
if ((DEFINED CONFIG_ELF_LAUNCH) AND (CONFIG_ELF_LAUNCH STREQUAL "y"))
list(REMOVE_ITEM deps ${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys_util/src/u_app_loader.c)
else()
list(REMOVE_ITEM deps ${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys_util/src/u_elf_loader.c)
list(REMOVE_ITEM deps ${CMAKE_SOURCE_DIR}/mkrtos_user/lib/sys_util/src/u_elf64.c)
endif()
add_library(

View File

@@ -59,9 +59,14 @@ add_custom_target(
mkdir -p ${CMAKE_SOURCE_DIR}/build/output/cpio
COMMAND
cp cpiofs.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/cpiofs
COMMAND
cp cpiofs.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/cpiofs.elf
)
if ((DEFINED CONFIG_ELF_LAUNCH) AND (CONFIG_ELF_LAUNCH STREQUAL "y"))
add_custom_target(
cpiofs_dump_elf ALL
COMMAND
cp cpiofs.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/cpiofs.elf
)
add_dependencies(cpiofs_dump_elf cpiofs_dump)
endif()
add_dependencies(cpiofs_dump cpiofs.elf)

View File

@@ -42,21 +42,26 @@ add_custom_target(
${CMAKE_OBJDUMP} -s -S init.elf > ${CMAKE_SOURCE_DIR}/build/output/init.S
# COMMAND
# ${CMAKE_READELF} -a init.elf > ${CMAKE_SOURCE_DIR}/build/output/init.txt
# COMMAND
# ${CMAKE_OBJCOPY} -O binary -S init.elf init.bin
COMMAND
${CMAKE_OBJCOPY} -O binary -S init.elf init.bin
COMMAND
${CMAKE_SIZE} init.elf
COMMAND
mkdir -p ${CMAKE_SOURCE_DIR}/build/output
# COMMAND
# cp init.bin ${CMAKE_SOURCE_DIR}/build/output/init
# COMMAND
# cp init.elf ${CMAKE_SOURCE_DIR}/build/output/init.elf
COMMAND
cp init.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/init.elf
cp init.bin ${CMAKE_SOURCE_DIR}/build/output/init
COMMAND
cp ${CMAKE_CURRENT_LIST_DIR}/src/init.cfg ${CMAKE_SOURCE_DIR}/build/output/cpio/
COMMAND
cp init.elf ${CMAKE_SOURCE_DIR}/build/output/init.elf
)
if ((DEFINED CONFIG_ELF_LAUNCH) AND (CONFIG_ELF_LAUNCH STREQUAL "y"))
add_custom_target(
init_dump_elf ALL
COMMAND
cp init.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/init.elf
)
add_dependencies(init_dump_elf init_dump)
endif()
add_dependencies(init_dump init.elf)
add_dependencies(init.elf libc_be util)

View File

@@ -47,9 +47,16 @@ add_custom_target(
COMMAND
mkdir -p ${CMAKE_SOURCE_DIR}/build/output/cpio
COMMAND
cp sh.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/sh.elf
cp sh.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/sh
)
if ((DEFINED CONFIG_ELF_LAUNCH) AND (CONFIG_ELF_LAUNCH STREQUAL "y"))
add_custom_target(
sh_dump_elf ALL
COMMAND
cp sh.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/sh.elf
)
add_dependencies(sh_dump_elf shell_dump)
endif()
add_dependencies(shell_dump sh.elf)
add_dependencies(shell_dump sys)
add_dependencies(shell_dump sys_util)

View File

@@ -78,10 +78,16 @@ add_custom_target(
mkdir -p ${CMAKE_SOURCE_DIR}/build/output/cpio
# COMMAND
# cp tcc.bin ${CMAKE_SOURCE_DIR}/build/output/cpio/tcc
COMMAND
cp tcc.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/tcc.elf
)
)
if ((DEFINED CONFIG_ELF_LAUNCH) AND (CONFIG_ELF_LAUNCH STREQUAL "y"))
add_custom_target(
tcc_dump_elf ALL
COMMAND
cp tcc.elf ${CMAKE_SOURCE_DIR}/build/output/cpio/tcc.elf
)
add_dependencies(tcc_dump_elf tcc_dump)
endif()
add_dependencies(tcc_dump tcc.elf)
add_dependencies(tcc_dump sys)
add_dependencies(tcc_dump sys_util)