修复STM32工程在linux上编译失败的问题
This commit is contained in:
@@ -90,9 +90,10 @@ endif()
|
||||
add_executable(bootstrap.elf
|
||||
${deps}
|
||||
)
|
||||
|
||||
message("CONFIG_CPU_TYPE"=${CONFIG_CPU_TYPE})
|
||||
string(TOUPPER ${CONFIG_CPU_TYPE} cpu_type)
|
||||
set_target_properties(bootstrap.elf PROPERTIES LINK_FLAGS
|
||||
"-T ${CMAKE_CURRENT_LIST_DIR}/bsp/${CONFIG_CPU_TYPE}/link.lds --gc-section ")
|
||||
"-T ${CMAKE_CURRENT_LIST_DIR}/bsp/${cpu_type}/link.lds --gc-section ")
|
||||
|
||||
target_link_libraries(
|
||||
bootstrap.elf
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
|
||||
file(GLOB_RECURSE deps **/*.S *.S **/*.C *.c)
|
||||
file(GLOB_RECURSE deps **/*.s *.s **/*.C *.c)
|
||||
|
||||
add_library(boot_bsp STATIC ${deps})
|
||||
target_include_directories(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
|
||||
file(GLOB_RECURSE deps **/*.S *.S **/*.C *.c)
|
||||
file(GLOB_RECURSE deps **/*.s *.s **/*.C *.c)
|
||||
|
||||
add_library(boot_bsp STATIC ${deps})
|
||||
target_include_directories(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
|
||||
file(GLOB_RECURSE deps **/*.S *.S **/*.C *.c)
|
||||
file(GLOB_RECURSE deps **/*.s *.s **/*.C *.c)
|
||||
|
||||
add_library(boot_bsp STATIC ${deps})
|
||||
target_include_directories(
|
||||
|
||||
@@ -53,6 +53,12 @@ void arch_enable_irq(int inx)
|
||||
{
|
||||
NVIC_EnableIRQ(inx);
|
||||
}
|
||||
uint32_t arch_get_sys_clk(void)
|
||||
{
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
return SystemCoreClock;
|
||||
}
|
||||
void arch_set_enable_irq_prio(int inx, int sub_prio, int pre_prio)
|
||||
{
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
@@ -116,3 +116,6 @@ void sys_reset(void);
|
||||
|
||||
// systick.c
|
||||
umword_t sys_tick_cnt_get(void);
|
||||
|
||||
uint32_t arch_get_sys_clk(void);
|
||||
|
||||
|
||||
@@ -53,6 +53,12 @@ void arch_enable_irq(int inx)
|
||||
{
|
||||
NVIC_EnableIRQ(inx);
|
||||
}
|
||||
uint32_t arch_get_sys_clk(void)
|
||||
{
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
return SystemCoreClock;
|
||||
}
|
||||
void arch_set_enable_irq_prio(int inx, int sub_prio, int pre_prio)
|
||||
{
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
@@ -116,3 +116,5 @@ void sys_reset(void);
|
||||
|
||||
// systick.c
|
||||
umword_t sys_tick_cnt_get(void);
|
||||
|
||||
uint32_t arch_get_sys_clk(void);
|
||||
|
||||
@@ -52,6 +52,12 @@ void arch_enable_irq(int inx)
|
||||
{
|
||||
NVIC_EnableIRQ(inx);
|
||||
}
|
||||
uint32_t arch_get_sys_clk(void)
|
||||
{
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
return SystemCoreClock;
|
||||
}
|
||||
void arch_set_enable_irq_prio(int inx, int sub_prio, int pre_prio)
|
||||
{
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
@@ -116,3 +116,5 @@ void sys_reset(void);
|
||||
|
||||
// systick.c
|
||||
umword_t sys_tick_cnt_get(void);
|
||||
|
||||
uint32_t arch_get_sys_clk(void);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
|
||||
file(GLOB deps **/*.S *.S **/*.C *.c)
|
||||
file(GLOB deps **/*.s *.s **/*.C *.c)
|
||||
|
||||
file(GLOB bsp_src
|
||||
${CMAKE_SOURCE_DIR}/mkrtos_bsp/SWM34/SWM341_StdPeriph_Driver/SWM341_StdPeriph_Driver/*.c
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
ENTRY(Reset_Handler)
|
||||
MEMORY
|
||||
{
|
||||
RAM (arw) : ORIGIN = 0x20000000, LENGTH = 0x10000
|
||||
FLASH (arx) : ORIGIN = 0x00000000 + 0x2000, LENGTH = 0x10000 - 0x2000
|
||||
RAM (arw) : ORIGIN = 0x20000000, LENGTH = 0x2000000
|
||||
FLASH (arx) : ORIGIN = 0x8000000 + 0x2000, LENGTH = 0x10000 - 0x2000
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# export TOOLCHAIN=/home/ATShining/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
# export TOOLCHAIN_LIB=/home/ATShining/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7-m
|
||||
export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7-m/nofp
|
||||
export TOOLCHAIN=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7-m
|
||||
# export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
# export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7-m/nofp
|
||||
export BOARD=STM32F103ZET6
|
||||
|
||||
set -e
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# export TOOLCHAIN=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
# export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7-m
|
||||
export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7-m/nofp
|
||||
export TOOLCHAIN=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7-m
|
||||
# export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
# export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7-m/nofp
|
||||
export BOARD=STM32F205
|
||||
|
||||
set -e
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# export TOOLCHAIN=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
# export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7-m
|
||||
export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
# export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7-m/nofp
|
||||
export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m+fp/hard
|
||||
export TOOLCHAIN=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7e-m/fpu
|
||||
# export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
# export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m+fp/hard
|
||||
export BOARD=STM32F407VET6
|
||||
set -e
|
||||
cmake -G Ninja -B build/$KNL .
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# export TOOLCHAIN=/home/ATShining/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
# export TOOLCHAIN_LIB=/home/ATShining/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv7-m
|
||||
export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
# export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main/nofp
|
||||
export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard
|
||||
export TOOLCHAIN=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/bin/
|
||||
export TOOLCHAIN_LIB=/home/zhangzheng/gcc-arm-none-eabi-5_4-2016q3/lib/gcc/arm-none-eabi/5.4.1/armv8-m.main/fpu/fpv5-d16/
|
||||
# export TOOLCHAIN=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/bin/
|
||||
# export TOOLCHAIN_LIB=/Users/zhangzheng/gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard
|
||||
export BOARD=SWM34
|
||||
|
||||
set -e
|
||||
|
||||
@@ -10,7 +10,11 @@
|
||||
#include <assert.h>
|
||||
static pthread_spinlock_t lock;
|
||||
extern void *app_start_addr;
|
||||
#ifdef CONFIG_EX_RAM_SIZE
|
||||
static umword_t mm_bitemp[ROUND(CONFIG_EX_RAM_SIZE, MK_PAGE_SIZE) / (sizeof(umword_t) * 8) + 1];
|
||||
#else
|
||||
static umword_t mm_bitemp[ROUND(CONFIG_KNL_DATA_SIZE, MK_PAGE_SIZE) / (sizeof(umword_t) * 8) + 1];
|
||||
#endif
|
||||
static void *mm_page_alloc(int page_nr)
|
||||
{
|
||||
int cnt = 0;
|
||||
|
||||
@@ -39,8 +39,8 @@ add_executable(tcc.elf
|
||||
target_link_libraries(tcc.elf
|
||||
PUBLIC
|
||||
muslc
|
||||
--whole-archive
|
||||
start
|
||||
--whole-archive
|
||||
sys
|
||||
sys_util
|
||||
sys_svr
|
||||
|
||||
Reference in New Issue
Block a user