S100 MCU CAN通讯打通

我使用的S100的板子,加mcu板子


事物为这样,按照手册里测通讯,我连接了CAN5与CAN6 却无法通讯成功
sunrise@ubuntu:/app/Can/can_get$ ./canhal_get bypass &
[1] 4831
sunrise@ubuntu:/app/Can/can_get$ [CANHAL][INFO][ipcf_dev.cpp:32][2025-7-17 15:19:59.950]:the path of ipcf plugin is /usr/hobot/lib/libhbipcfhal.so.1.
group name is bypass
[CANHAL][INFO][comps_mgr.cpp:158][2025-7-17 15:19:59.952]:channel constructor Register dev: ipcf success.
[CANHAL][INFO][node.cpp:17][2025-7-17 15:19:59.952]:channel id is 0
[CANHAL][ERROR][can_hal_impl.cpp:168][2025-7-17 15:19:59.953]:Init Node failed.
[CANHAL][ERROR][can_hal_impl.cpp:170][2025-7-17 15:19:59.953]:Create Or Init node failed.
INIT ERROR!

[1]+ Exit 255 ./canhal_get bypass

sunrise@ubuntu:/app/Can/can_get$ sudo ./canhal_get bypass &
[1] 4832
sunrise@ubuntu:/app/Can/can_get$ [CANHAL][INFO][ipcf_dev.cpp:32][2025-7-17 15:20:28.815]:the path of ipcf plugin is /usr/hobot/lib/libhbipcfhal.so.1.
group name is bypass
[CANHAL][INFO][comps_mgr.cpp:158][2025-7-17 15:20:28.816]:channel constructor Register dev: ipcf success.
[CANHAL][INFO][node.cpp:17][2025-7-17 15:20:28.816]:channel id is 0
[INFO][hb_ipcf_hal.cpp:282] [channel] bypass [ins] 0 [id] 4 init success.
[INFO][hb_ipcf_hal.cpp:333] [channel] bypass [ins] 0 [id] 4 config success.
[CANHAL][INFO][node.cpp:39][2025-7-17 15:20:28.817]:io_channel init successful
[CANHAL][INFO][node.cpp:44][2025-7-17 15:20:28.817]:protocol is built_1.0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:32.958]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11


[bypass] [pack]length: 0 soc_ts: 0 mcu_ts: 0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:37.54]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11


[bypass] [pack]length: 0 soc_ts: 0 mcu_ts: 0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:41.150]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11


[bypass] [pack]length: 0 soc_ts: 0 mcu_ts: 0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:45.246]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11


[bypass] [pack]length: 0 soc_ts: 0 mcu_ts: 0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:49.342]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11


[bypass] [pack]length: 0 soc_ts: 0 mcu_ts: 0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:53.438]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11


[bypass] [pack]length: 0 soc_ts: 0 mcu_ts: 0
[CANHAL][ERROR][ipcf_dev.cpp:136][2025-7-17 15:20:57.534]:HorizonHal_IPCF_Recv of id:0 failed, ret is -11

sunrise@ubuntu:~$ cd /app/Can/can_send/
sunrise@ubuntu:/app/Can/can_send$ make
mkdir -p /app/Can/can_send
echo CC /app/Can/can_send/canhal_send.o
CC /app/Can/can_send/canhal_send.o
cc -I/include/canhal/ -I/usr/hobot/include/canhal/ -I/include/ -c canhal_send.c -o /app/Can/can_send/canhal_send.o
mkdir -p /app/Can/can_send
echo CC /app/Can/can_send/canhal_send
CC /app/Can/can_send/canhal_send
cc -Wall -DUSER_API_VERSION_MAJOR=1 -DUSER_API_VERSION_MINOR=0 -DUSER_API_VERSION_PATCH=0 -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -Wno-sizeof-pointer-memaccess -I/include/canhal/ -I/usr/hobot/include/canhal/ -I/include/ /app/Can/can_send/canhal_send.o -L/usr/hobot/lib/ -L/app/Can/can_send -lhbcanhal -lpthread -o /app/Can/can_send/canhal_send
sunrise@ubuntu:/app/Can/can_send$ sudo ./canhal_send bypass 6
[CANHAL][INFO][ipcf_dev.cpp:32][2025-7-17 15:20:48.23]:the path of ipcf plugin is /usr/hobot/lib/libhbipcfhal.so.1.
group name is bypass
[CANHAL][INFO][comps_mgr.cpp:158][2025-7-17 15:20:48.24]:channel constructor Register dev: ipcf success.
[CANHAL][INFO][node.cpp:17][2025-7-17 15:20:48.24]:channel id is 0
[INFO][hb_ipcf_hal.cpp:282] [channel] bypass [ins] 0 [id] 6 init success.
[INFO][hb_ipcf_hal.cpp:333] [channel] bypass [ins] 0 [id] 6 config success.
[CANHAL][INFO][node.cpp:39][2025-7-17 15:20:48.25]:io_channel init successful
[CANHAL][INFO][node.cpp:44][2025-7-17 15:20:48.25]:protocol is built_1.0
[CANHAL][ERROR][ipcf_dev.cpp:160][2025-7-17 15:20:48.25]:HorizonHal_IPCF_Send of id:0 failed, ret is -14
canSendMsgFrame failed ret: -14
Send end, send package total: 1 frame total: 1
[CANHAL][INFO][can_hal_impl.cpp:120][2025-7-17 15:20:48.25]:Deinit node: bypass
[INFO][hb_ipcf_hal.cpp:553] [channel] bypass [ins] 0 [id] 6 deinit success.
[CANHAL][INFO][can_hal_impl.cpp:128][2025-7-17 15:20:48.25]:Deinit node: bypass
[CANHAL][INFO][channel_ctor.cpp:47][2025-7-17 15:20:48.25]:Deinit device: ipcf
sunrise@ubuntu:/app/Can/can_send$

请各位帮忙指导下,赠送周边给各位

1 个赞

你好! CAN使用指南 | RDK DOC 中的应用sample章节有相关说明。需要自己配置chan,/app/Can/can_multi_ch/config/ipcf_channel.json 有相应的硬件chan和软件chan对应关系,根据需要修改ipcf_channel.json。

物理chan与软件chan对应关系如下;

以can8发送can9接收为例
can9配置

can8配置

接收:./canhal_get bypass
发送:./canhal_send bypass 8