坐听风雨 发表于 2023-11-7 10:47:30

IAR命令行编译成功但是报错

使用IAR8.20.1版本,要上jenkins使用bat脚本命令行编译,概率出现编译编译完了,日志都正常,但是最后出现一句 ERROR,Command failed:build,导致我判断bat脚本返回值时失败了。此时重编就正常了。直接用IDE编译不会出现问题。


失败时候的日志:

    IAR ELF Linker V8.20.1.14183/W32 for ARM
    Copyright 2007-2017 IAR Systems AB.

    411 754 bytes of readwrite code memory
    525 584 bytes of readonly data memory
    305 378 bytes of readwrite data memory

Errors: none
Warnings: none

Link time:    1.16 (CPU)    2.39 (elapsed)

Total number of errors: 0
Total number of warnings: 19


ERROR, Command failed: build



这是我的脚本:
@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的过程:

    IAR ELF Linker V8.20.1.14183/W32 for ARM
   Copyright 2007-2017 IAR Systems AB.

    411 754 bytes of readwrite code memory
    525 584 bytes of readonly data memory
    305 378 bytes of readwrite data memory

Errors: none
Warnings: none

Link time:    1.22 (CPU)    2.06 (elapsed)

IS650N.out
Converting
ielftool.exe --ihex --verbose d:\Project\Debug\Exe\project.out d:\Project\Debug\Exe\project.hex

    IAR ELF Tool V10.2.1.194
    Copyright 2007-2017 IAR Systems AB.

Loading d:\Project\Debug\Exe\project.out
Saving ihex file to d:\Project\Debug\Exe\project.hex

Total number of errors: 0
Total number of warnings: 19





eric2013 发表于 2023-11-7 11:51:40

用坛友这个试试。

为了用Jenkins自动编译,IAR工程加了bat编译脚本
https://www.armbbs.cn/forum.php?mod=viewthread&tid=109503

坐听风雨 发表于 2023-11-7 15:22:09

eric2013 发表于 2023-11-7 11:51
用坛友这个试试。

为了用Jenkins自动编译,IAR工程加了bat编译脚本


谢谢,试了下,还是会偶发错误,提示ERROR, Command failed: make

坐听风雨 发表于 2023-11-7 15:59:22

不纠结了,捕获到失败就重试
页: [1]
查看完整版本: IAR命令行编译成功但是报错