使用IAR8.20.1版本,要上jenkins使用bat脚本命令行编译,概率出现编译编译完了,日志都正常,但是最后出现一句 ERROR,Command failed:build,导致我判断bat脚本返回值时失败了。此时重编就正常了。直接用IDE编译不会出现问题。
失败时候的日志:
[C] 纯文本查看 复制代码 [2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z] IAR ELF Linker V8.20.1.14183/W32 for ARM
[2023-11-07T01:44:18.691Z] Copyright 2007-2017 IAR Systems AB.
[2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z] 411 754 bytes of readwrite code memory
[2023-11-07T01:44:18.691Z] 525 584 bytes of readonly data memory
[2023-11-07T01:44:18.691Z] 305 378 bytes of readwrite data memory
[2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z] Errors: none
[2023-11-07T01:44:18.691Z] Warnings: none
[2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z] Link time: 1.16 (CPU) 2.39 (elapsed)
[2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z] Total number of errors: 0
[2023-11-07T01:44:18.691Z] Total number of warnings: 19
[2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z]
[2023-11-07T01:44:18.691Z] ERROR, Command failed: build
这是我的脚本:
[C] 纯文本查看 复制代码 @echo off
"%IAR_INSTALL_PATH%" . \project.ewp -build Debug -log all -parallel 4
if %ERRORLEVEL% GTR 1 (
echo build failed!
exit 2
)else (
echo build success
exit 0
)
如果不加 -parallel 4 多线程编译参数,就更容易出错
这个是正常时候的日志,多了一个将out转为hex的过程:
[C] 纯文本查看 复制代码
[2023-11-07T02:23:27.1987] IAR ELF Linker V8.20.1.14183/W32 for ARM
[2023-11-07T02:23:27.1987] Copyright 2007-2017 IAR Systems AB.
[2023-11-07T02:23:27.1987]
[2023-11-07T02:23:27.1987] 411 754 bytes of readwrite code memory
[2023-11-07T02:23:27.1987] 525 584 bytes of readonly data memory
[2023-11-07T02:23:27.1987] 305 378 bytes of readwrite data memory
[2023-11-07T02:23:27.1987]
[2023-11-07T02:23:27.1987] Errors: none
[2023-11-07T02:23:27.1987] Warnings: none
[2023-11-07T02:23:27.1987]
[2023-11-07T02:23:27.1987] Link time: 1.22 (CPU) 2.06 (elapsed)
[2023-11-07T02:23:27.1987]
[2023-11-07T02:23:27.198Z] IS650N.out
[2023-11-07T02:23:27.198Z] Converting
[2023-11-07T02:23:27.198Z] ielftool.exe --ihex --verbose d:\Project\Debug\Exe\project.out d:\Project\Debug\Exe\project.hex
[2023-11-07T02:23:27.198Z]
[2023-11-07T02:23:27.198Z] IAR ELF Tool V10.2.1.194 [BUILT at IAR]
[2023-11-07T02:23:27.198Z] Copyright 2007-2017 IAR Systems AB.
[2023-11-07T02:23:27.198Z]
[2023-11-07T02:23:27.198Z] Loading d:\Project\Debug\Exe\project.out
[2023-11-07T02:23:27.198Z] Saving ihex file to d:\Project\Debug\Exe\project.hex
[2023-11-07T02:23:27.198Z]
[2023-11-07T02:23:27.198Z] Total number of errors: 0
[2023-11-07T02:23:27.198Z] Total number of warnings: 19
|