编译固件时报错如下,如何处理

Viewed 40

重现步骤

ubuntu@ubuntu2004:~/rtos_k230$ time make log
Using prebuilt U-Boot binaries, skipping compilation
/home/ubuntu/rtos_k230//src/uboot/gen_image || exit build;
=== U-Boot Image Generation Script ===
2025年 07月 14日 星期一 12:52:07 CST
Starting U-Boot image generation...
Copying U-Boot environment file...
'/home/ubuntu/rtos_k230//boards/k230_canmv_v3p0/default.env' -> '/home/ubuntu/rtos_k230//output/k230_canmv_v3p0_defconfig/images/uboot/uboot.env'
Generating environment binary...
Environment binary generated: /home/ubuntu/rtos_k230//output/k230_canmv_v3p0_defconfig/images/uboot/env.bin
WARNING: U-Boot .config not found, using default text base 0x1000000
Generating U-Boot binary with text base: 0x1000000
Image Name: uboot
Created: Mon Jul 14 12:52:07 2025
Image Type: RISC-V U-Boot Firmware (gzip compressed)
Data Size: 302711 Bytes = 295.62 KiB = 0.29 MiB
Load Address: 01000000
Entry Point: 01000000
the magic is: b'K230'
----- NO ENCRYPTION + HASH-256 -----
the encryption type: 0
mesg_hash: b'dbc676f8b891e6e02d61165e1dd1acc8a5350dd147ff2f95c25f4d18919cf54f'
the magic is: b'K230'
----- NO ENCRYPTION + HASH-256 -----
the encryption type: 0
mesg_hash: b'308866d38acfa1232a463a9cf69455e9dea66ee7a2a4f5407bc6525ea8b5fafc'
U-Boot binaries generated successfully
U-Boot image generation completed successfully
2025年 07月 14日 星期一 12:52:07 CST
[CC] src/sensor_comm.c
[CC] src/sensor_dev.c
In file included from /home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:74,
from /home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/rtdef.h:500,
from /home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/rtthread.h:24,
from src/sensor_dev.c:26:
/home/ubuntu/.kendryte/k230_toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/riscv64-unknown-linux-musl/include/signal.h:92:7: error: redefinition of 'union sigval'
92 | union sigval {
| ^~~~~~
/home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:28:7: note: originally defined here
28 | union sigval
| ^~~~~~
/home/ubuntu/.kendryte/k230_toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/riscv64-unknown-linux-musl/include/signal.h:145:3: error: conflicting types for 'siginfo_t'; have 'struct '
145 | } siginfo_t;
| ^~~~~~~~~
/home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:55:24: note: previous declaration of 'siginfo_t' with type 'siginfo_t' {aka 'struct siginfo'}
55 | typedef struct siginfo siginfo_t;
| ^~~~~~~~~
/home/ubuntu/.kendryte/k230_toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/riscv64-unknown-linux-musl/include/signal.h:179:8: error: redefinition of 'struct sigevent'
179 | struct sigevent {
| ^~~~~~~~
/home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:36:8: note: originally defined here
36 | struct sigevent
| ^~~~~~~~
In file included from /home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:74,
from /home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/rtdef.h:500,
from /home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/rtthread.h:24,
from src/sensor_dev.h:36,
from src/sensor_comm.c:27:
/home/ubuntu/.kendryte/k230_toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/riscv64-unknown-linux-musl/include/signal.h:92:7: error: redefinition of 'union sigval'
92 | union sigval {
| ^~~~~~
/home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:28:7: note: originally defined here
28 | union sigval
| ^~~~~~
/home/ubuntu/.kendryte/k230_toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/riscv64-unknown-linux-musl/include/signal.h:145:3: error: conflicting types for 'siginfo_t'; have 'struct '
145 | } siginfo_t;
| ^~~~~~~~~
/home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:55:24: note: previous declaration of 'siginfo_t' with type 'siginfo_t' {aka 'struct siginfo'}
55 | typedef struct siginfo siginfo_t;
| ^~~~~~~~~
/home/ubuntu/.kendryte/k230_toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/riscv64-unknown-linux-musl/include/signal.h:179:8: error: redefinition of 'struct sigevent'
179 | struct sigevent {
| ^~~~~~~~
/home/ubuntu/rtos_k230//src/rtsmart/rtsmart/kernel/rt-thread/include/libc/libc_signal.h:36:8: note: originally defined here
36 | struct sigevent
| ^~~~~~~~
make[4]: *** [Makefile:46:/home/ubuntu/rtos_k230//output/k230_canmv_v3p0_defconfig/rtsmart/mpp/kernel/sensor/src/sensor_comm.o] 错误 1
make[4]: *** 正在等待未完成的任务....
make[4]: *** [Makefile:46:/home/ubuntu/rtos_k230//output/k230_canmv_v3p0_defconfig/rtsmart/mpp/kernel/sensor/src/sensor_dev.o] 错误 1
make[3]: *** [Makefile:4:all] 错误 2
make[2]: *** [Makefile:63:mpp] 错误 2
make[1]: *** [Makefile:87:rtsmart] 错误 2

real 0m0.599s
user 0m0.212s
sys 0m0.431s

期待结果和实际结果

软硬件版本信息

错误日志

尝试解决过程

补充材料

2 Answers

你好,请问你是否修改了rtsmart的配置?

没有修改,使用的 k230_canmv_v3p0_defconfig默认配置