94
4126
1万
资深工程师
使用特权
-DTOOLCHAIN_DIR=/home/sunqi/program/gcc-arm-none-eabi-5_4-2016q3 -DCMAKE_TOOLCHAIN_FILE=/home/sunqi/Desktop/mcu_proj/conf/t
include(CMakeForceCompiler) set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_PROCESSOR cortex-m3) find_program(ARM_CC arm-none-eabi-gcc ${TOOLCHAIN_DIR}/bin) find_program(ARM_CXX arm-none-eabi-g++ ${TOOLCHAIN_DIR}/bin) find_program(ARM_OBJCOPY arm-none-eabi-objcopy ${TOOLCHAIN_DIR}/bin) find_program(ARM_SIZE_TOOL arm-none-eabi-size ${TOOLCHAIN_DIR}/bin) CMAKE_FORCE_C_COMPILER(${ARM_CC} GNU) CMAKE_FORCE_CXX_COMPILER(${ARM_CXX} GNU) set(CMAKE_ARM_FLAGS "-mcpu=cortex-m3 -mthumb -fno-common -ffunction-sections -fdata-sections" ) if(CMAKE_SYSTEM_PROCESSOR STREQUAL"cortex-m3") set(CMAKE_C_FLAGS"${CMAKE_C_FLAGS} ${CMAKE_ARM_FLAGS}") set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} ${CMAKE_ARM_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS"${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_ARM_FLAGS}") else() message(WARNING "Processor not recognised in toolchain file," "compiler flags not configured." ) endif() # fix long strings (CMake appends semicolons) string(REGEX REPLACE";" " "CMAKE_C_FLAGS"${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS"${CMAKE_C_FLAGS}"CACHE STRING"") set(BUILD_SHARED_LIBS OFF)
openocd的默认tcp 调试端口是3333。 symbol file的路径是 project/build/xxx.elf 看你项目的名字了 xxx 由项目根目录下CMakeList 文件中的项目名字决定。
767985d23e16b16305.png (201.36 KB )
下载附件
2019-7-9 08:35 上传
85
4090
0
6
18
实习生
发表回复 本版积分规则 回帖后跳转到最后一页
2
扫码关注 21ic 官方微信
扫码关注嵌入式微处理器
扫码关注21ic项目外包
扫码关注21ic视频号
扫码关注21ic抖音号
本站介绍 | 申请友情链接 | 欢迎投稿 | 隐私声明 | 广告业务 | 网站地图 | 联系我们 | 诚聘英才 | 论坛帮助
京公网安备 11010802024343号