This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:Code Composer Studio
我希望使用 GCC 来编译一些代码(以便我可以集成其他一些已在 GCC 工具中编译的库)。 我在 Halcogen 中启用了'GCC'选项以生成一些代码、并在 CCS 中将其打开。 我将 CCS 中的工具链更改为 GCC (GNU v7.2.1 Linaro)、并添加了以下标志以消除有关它说不受支持的某些指令的错误、
-mcpu=cortex-R5 -mfloat-abi=硬
我的完整构建命令是、
-mcpu=cortex-r5 -mfloat-abi=hard -i"C:/Users/Andrew/Code/ti_projects/demo_server -i"C:/Users/Andrew/Code/ti_projects/demo_server/include -i"C:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include -og -g -gdwarf-3 -gstrict-dwarf -Wall
但我现在遇到几千个错误、我想其中一些看起来像是.asm 文件中的注释被读取为指令?
下面是误差输出的一个片段:
我尝试添加-MCC 标志、但它是编译器无法识别的标志。 侧注:我使用的是 Windows 10
如果有人能帮我解决这个问题、我将不胜感激。
我尚未尝试为 具有 GCC 的 TMS570LC4357创建 HalCoGen 以调查汇编器错误的原因、但初步搜索发现 如何在 TMS570上使用 GCC 创建工程 、这是另一个问题:
另外、您使用的是哪个版本的 HalGoGen?
我在 CCS 10.0.0上
[引用 user="Andrew Rooney">但我现在遇到数千个错误、我认为其中一些错误看起来像是.asm 文件中的注释被读取为指令? HalCoGen 代码生成创建了:
由于尝试将哪些注释编译为汇编器语句、与 GCC 编译器配合使用时、.asm 汇编器文件会生成大量错误。
当一个新的 HalCoGen 项目被创建时、工具选项的缺省选择为 "Texas Instrument Tools"。
若要删除工程中的汇编器错误、请尝试:
[引用用户="Andrew Rooney"]
我将 CCS 中的工具链更改为 GCC (GNU v7.2.1 Linaro)、并添加了以下标志以消除有关它说不受支持的某些指令的错误、
1
|
-mcpu=cortex-r5 -mfloat-abi=hard |
当我使用 CCS 10、HalCoGen 04.06.00和 gcc-arm-none-eabi-7-2017-Q4-majer-Win32时、我发现这两个选项不足以消除有关不受支持指令的错误、我还必须添加 -mfpu=vpv3-D16
我能够 使用 GNU v7.2.1为 TMS570LC4357编译和链接一个 HalCoGen 项目、但该程序不运行、因为执行的第一条指令会导致一个未定义指令异常。 生成的可执行文件是小端字节序、这是 ARM GCC 的默认选项、但 TMS570LC4357是大端字节序。
尝试将 -mbig-endian 选项添加到编译器、然后会导致链接器出错:
调用: "GNU Linker "C:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc-7.2.1.exe /source/HL_crc.o /source/HL_emac.o /source/HL_eqep.o /source/HL_etpwm.o /source/HL_i2c.o /source/HL_mibspi.o /source/HL_phy_dp83640.o /source/HL_pom.o /source/HL_sys_core.o /source/HL_sys_main.o /source/HL_sys_phantom.o /source/HL_sys_startup.o -og -g -gdwarf-3 -gstrict-dwarf -Wall -speces="nosys.specs"-mbig-endian -mfloat-abi=hard -wl、-Map、"TMS570LC4357_gcc_halcogen.map"-o"-mbig-mfloat-mfloat-mfloat-mfloat-wi-abi=hard -wl -wl -wl -wl -wl -wl -wl -wl -wl -wl -wl -wl /source/HL_can.o "/source/HL_ecap.o "/source/HL_epc.o "/source/HL_esm.o "/source/HL_het.o "/source/HL_mdio.o "/source/HL_notification.o "./source/HL_pinmux.o "/source/HL_sci.o "./source/HL_sys_intvecs.o ".""/source/HL_adc.o /source/HL_dcc.o /source/HL_emif.o /source/HL_errata.o /source/HL_gio.o /source/HL_lin.o /source/HL_nmpu.o /source/HL_phy_tlk111.o /source/HL_rti.o /source/HL_sys_dma.o /source/HL_sys_mpu.o /source/HL_sys_pmm.o /source/HL_sys_vim.o "./source/HL_sys_pcr.o /source/HL_sys_pmu.o "./source/HL_system.o -WL、-t"。/source/HL_sys_link.ld makefile:177:目标'TMS570LC4357_gcc_halcogen.out'的配方失败 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crti.o:为小端系统编译、目标为大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crti.o /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crtbegin.o:为小端字节序系统编译、c:: 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crtbegin.o c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard/crt0.o:为小端字节序系统编译、目标为大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard/crt0.o c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard libc.a (lib_a-exit.o):为小端字节序系统编译、目标为大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard \libc.a (lib_a-exit.o) c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard \libc.a (lib_a-imure.o):为小端系统 编译、目标是大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe \libc.a (lib_c.a)的目标特定数据:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard 的目标特定数据\libc.a (lib_a-init.o) c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard libc.a (lib_a-memcpi-stub.o):为小端系统编译、目标是大端 字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 的目标特定数据(libc.a):big 端字节序 c:a:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard \libc.a (lib_a-memset.o) c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:C:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe \libc.a (lib_a-_call_atexit.o)的目标特定数据:为小端系统编译、目标是大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 的目标特定数据\libc_(libc.a):lib_enidian.c:a:lib_enidian.c: 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard libc.a (lib_a-atexit.o) c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard libc.a (lib_a-fini.o):为小端系统编译、目标是大端 字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe libc.a (lib_c.a)的目标特定数据:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard \libc.a (lib_a-lock.o) c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard \libc.a (lib_a-_atexit.o):为小端系统编译、目标是大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard 的目标特定数据\libc.a: /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe (little_little_endian):/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard libm.a (lib_a-s_floor.o) c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard libnosys.a (_exit.o):为小端系统编译、目标是大端 字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crtend.o:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/hard /ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe 的目标特定数据(_nosys.a):/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:小端字节序 c:c: 无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crtend.o c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crtn.o:为小端系统编译、目标为大端字节序 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe:无法合并文件 c:/ti/ccs1000/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/hard/crtn.o collect2.exe 的目标特定数据:错误:LD 返回1退出状态
我认为这是因为 gcc-arm-none-eabi-7-Q4-majer-Win32提供的运行时库默认仅针对小端字节序进行编译。 根据我之前提到的帖子、我认为需要重新构建 gcc 以启用大端运行时间库。
感谢大家。
谢谢切斯特、我昨天晚上很晚才实现了这一状态。 我还没有做的是找到任何资源、告诉我如何实际获得大端字节序 C 运行时库、因此如果遇到这种情况、请告诉我!
[引用 user="Andrew Rooney">我还没有想到的是找到任何资源、告诉我如何实际获得大型端字节序 C 运行时库、因此如果您偶然发现、 请告诉我![/QUERT]TMS570LS和 GCC 编译 器包含一个 ARM GCC 5 2015q4源代码补丁、以启用大端运行时库。
我已经下载 了 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-src.tar.bz2 源文件、并且正在按照 How-to-build-toolchain.pdf 中的说明构建 GNU v7.2.1、尝试为该版本创建合适的补丁。
编辑: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads 包含不同版本源代码的下载链接。
我遇到的第一个问题是 install-sources.sh 脚本失败,没有任何明显的错误。Chester Gillon 说:我正在按照 How-to-build-toolchain.pdf 中的说明构建 GNU v7.2.1,尝试为该版本创建合适的修补程序。
结果、它尝试下载 libelf 源的网站返回了 HTTP 404 ( 如 https://github.com/oracle/crashcart/issues/14所述)
为了让 install-sources.sh 完整、在 gcc-arm-none-eabi-7-2017-Q4-maj/build-common.sh 中 、必须从
LIBELF_URL=www.mr511.de/.../$LIBELF_PACK
至:
LIBELF_URL=fossies.org/.../$LIBELF_PACK
我能够构建修改后的 GNU v7.2.1 (gcc-arm-no-eabi-7-cc-Q4-major),其中 修改了 src/gcc/mdie/config 作为 multi-lib-config/gendian 文件的支持 armv7-ar。Chester Gillon 说:按照 How-to-build-toolchain.pdf 中的指令构建 GNU v7.2.1,尝试为该版本创建合适的修补程序。
虽然 能够为大端字节序编译和链接 TMS570LC4357的示例、但生成的示例程序无法正确设置外设。 在调试器中单步执行时、发现为 HalGoGen 生成 的 getResetSource 函 数生成的汇编器不正确、导致_c_int00无法检测复位源、无法初始化时钟并从复位中释放外设。
我返回到未经修改 的 GNU v7.2.1、即使是为小端字节序编译 、为 getResetSource 函 数生成的汇编器也是错误的、其方式与修改后的 GNU v7.2.1编译器相同。 即、似乎是编译器存在的问题、而不是由我的更改(仅针对构建的运行时库版本)引入的问题。
[引用 user="Andrew Rooney"]我将 CCS 中的工具链更改为 GCC (GNU v7.2.1 Linaro)[/quot]
您是否需要使用 GNU v7.2.1、或者我是否可以使用更高版本的编译器尝试相同的修改?
我的 CCS 10安装还提供 GNU arm v7.3.1和 v9.2.1。
再次感谢您的帮助。
无论 GNU 的版本是什么,我们都应该很好,7.2.1只是默认提供的版本。
[引用 user="Chester">虽然 可以 为大端字节序编译和链接 TMS570LC4357的示例、但生成的示例程序无法正确设置外设。 在调试器中单步执行时发现、为 HalGoGen 生成 的 getResetSource 函数生成的汇编器不正确、导致 _c_int00无法检测到复位源、并且无法初始化时钟并释放外设以防止复位。进一步调查时、问题不是编译器问题、 但 HalCoGen 中的错误 Hercules _SW-6008 "getResetSource GCC naked Attribute should be removed" 04.07.00。
升级到 HalCoGen 04.07.01修复了该问题(正如我在 https://e2e.ti.com/support/tools/ccs/f/81/t/909137中所描述的那样)。
使用大端字节序运行时间库重新构建的基于 v7.2.1 I 的 GCC ARM 可从 gcc-arm-none-eabi-7-2020-Q2-update 获取。 这包括更新的源代码以及 Windows 和 Linux 可执行文件。 这是我的 Google 驱动器上的内容、我应该将其设置为共享-请告诉我是否无法访问。
我将版本号更改为7.2.1p1、以明确它是一个修改版本、而不是 CCS 安装的标准版本。 如果您将其安装在 CCS CCS/tools/compiler 目录中、CCS 应该会发现它、并且能够在项目中选择 Compiler Version "GNU v7.2.1p1 (Linaro)":
我为 一个 TMS570LC4357附加了一个示例 CCS 10项目、此项目是使用 HalCoGen 通过上述编译器构建的 04.07.01。
在 CCS Build -> GNU Linker -> Miscellaneous 下的 CCS 工程属性中、我必须添加以下标志、以使链接器选择合适的运行时库:
-mcpu=cortex-R5 -mfpu=vfpv3-D16 -mbig-endian
参考 gcc-arm-none-eabi-7-2017-Q4主要来源的更改如下:
1.将用于下载 libelf 源的 URL 更改为活动的 URL:
$ git diff /mnt/gcc_arm_toolchain/gcc-arm-none-eabi-7-2017-q4-major/build-common.sh build-common.sh build-common.sh @@ ftp.gnu.org/.../$MPC_PACK www.mr511.de/.../$LIBELF_PACK www.zlib.net/.../$ZLIB_PACK diff --git a/mnt/gcc_arm_toolchain/gcc-arm-no-eabi-7-2017-Q4-maj/build-common.sh build-common.sh index 0cb4808..5383a89 100755 -- a/icon/gcc_arm_toolchain/gabi-arm-none-eurp=build-common.sh;index @@ 0cb=isl.gforge.inria.fr/$ISL_PACK ftp.gnu.org/.../$MPFR_PACK fossies.org/.../$LIBELF_PACK downloads.sourceforge.net/.../$EXPAT_PACK nsis.sourceforge.net/.../$ENV_VAR_UPDATE_PACK ftp.gnu.org/.../$LIBICONV_PACK infr_url-urp=r=url-url-url-es=;
2.更改版本:
$ git diff /mnt/gcc_arm_toolchain/gcc-arm-none-eabi-7-2017-q4-major/src/gcc/gcc/BASE-VER src="/gcc/gcc/base-VER diff --git a/mnt/gcc_arm_toolchain/gcc-arm-no-eabi-7-2017-Q4-maj/src/gcc/g75/base-VER b/gcc/gcc/base-mntold mode 1002017 new mode 100ab-7-gabi+2.1-gab/gcc-gma-g7b/gcc-gma-gcc-gi+-gcc-gmnt/gcc-gcc-gi+1.7a/gcc-gcc-gcc-mnt-g2.1-gcc-gcc-g2.1-gcc-gcc-gcc-gcc-g2.1-gr b-gcc-gcc-gcc-gcc-gcc-gcc-gcc-gcc-mnt- @@@@
3.修改 t-rmprofile Makefile 片段以添加 Cortex-R 运行时库的构建大端版本:
$ git diff /mnt/gcc_arm_toolchain/gcc-arm-none-eabi-7-2017-q4-major/src/gcc/gcc/config/arm/t-rmprofile src="/gcc/config/arm/t-rmprofile | cat diff --git a/mnt/gcc_arm_toolchain/gcc-arm-no-eabi-7-2017-Q4-maj/src/gcc/config/t-rmprofileb/gcc/gmrmprofile/gcc-mode/gcc-rm Ω rm Ω/gcc-rm Ω/rm Ω/gcc-rm Ω@@–g75/gcc-rm Ω/rm Ω/gcc-rm Ω/rm Ω@@-rm Ω/rm Ω/gcc-rm Ω/rm Ω/gcc-rm Ω/rm Ω/gcc-rm Ω/gcc-rm Ω/rm Ω/rm Ω = # FPU:VFPv3-D16 (fpv3)、FPV4-SP-D16 (fpv4-sp)、FPV5-SP-D16 (fpv5-sp)、 # VFPv5-D16 (fpv5)、或者无(.)。 # Floot-ABI:软(.)、软(softfp)或硬(hardfp)。 ##字节序:小(.) 或大(大端字节序) #选项以使用 @@-52.6+53.9 @@ MULTILIB_DIRNAMES += fpv3 fpv4-sp fpv5-sp fpv5 MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard MULTILIB_DIRNAMES += softfp hard +MULTILIB_OPTIONS +=大端 字节序+MULTILIB_DIRNAMES +=大端字节序 + #选项组合、用于构建 具有@@-86、6 + 90、9 @@ MULTILIB_required 的库 += mthum/March = ARMv8-m.main/mfpu=fpv5-sp-D16/mfloat-abi= MULTILIB_required += mthum/March = armv7 MULTILIB_REQUIRED += mthumb/March = armv7/mfpu=vfpv3-D16/mfloat-abi=softfp MULTILIB_required += mthumb/March = armv7/mfpu=vfpv3-D16/mfloat-abi=hard +MULTILIB_REQUIRED += mthume/March = armv7/mbig-endian +MULTILIB_REQUIRED += mthumb/March = armv7/mfpu=vfpv3-D16/mfloat-abi=softfp/mbig-endian +MULTILIB_required += mthum/March = armv7/mfpu=vfpv3-D16/mfloat-abi=hard/mbig-endian #匹 配@@-171、6 +178、13 @@ MULTILIB_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.softfp=ma MULTILIBI_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.hard=March.armv7/mfpu.fpv5-D16/mfloat-abi.hard MULTILIB_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.softfp=mthum/March.armv7/mfpu.fpv5-D16/mfloat-abi.softfp MULTILIB_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.hard=mthum/March.armv7/mfpv5-D16/mfloat-abi.hard +MULTILIB_reuse += mthum/March.armv7/mbig-endian=March.armv7/mbig-endian +MULTILIB_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.softfp/mbig-endian=March.armv7/mfpu.vfpv3-D16/mfloat-abi.softfp/mbig-endian +MULTILIb_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.hard/mbig-endian=March.armv7/mfpu.vfpv3-D16/mfloat-abi.hard/mbig-endian +MULTILIB_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.softfp/mbig-endian=March.armv7/mfpu.fpv5-D16/mfloat-abi.softfp/mbig-endian +MULTILIb_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.hard/mbig-endian=March.armv7/mfpv5-D16/mfloat-abi.hard/mbig-endian +MULTILIB_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.softfp/mbig-endian=mthum/March.armv7/mfpv5-D16/mfloat-abi.softfp/mbig-endian +MULTILIb_reuse += mthum/March.armv7/mfpu.vfpv3-D16/mfloat-abi.hard/mbig-endian=mthum/March.armv7/mfpu.fpv5-D16/mfloat-abi.hard/mbig-endian # Map ARMv7E-M FPV5-SP-D16-MPV16-D16重复 使用 += mthum/March.armv7e-m/mfpu.fpv4-sp-D16/mfloat-abi.softfp=mthum/March.armv7e-m/mfpu.fpv5-sp-D16/mfloat-abi.softfp