I am using version R35.6.2 (JP5.1.5) on Xavier, and I encountered an issue while using the ivc echo demo. When I modified the line ivc_echo_task_write_msg((void *)rx_msg, 64); in the ivc_echo_task_process_ivc_messages function to ivc_echo_task_write_msg((void *)rx_msg, 11);, the freeRtos crashed upon sending. What could be the reason for this?
Only sending 11 bytes will cause a crash, while other lengths are normal.
any crash log in AON side? can you provide the patch which I can reproduce the issue locally? I made a quick survey for the code in ivc_echo_task_write_msg and do not find the issue regarding to length change. It only involves validation checking and following memcpy.
br
ChenJian
Hi there,
There are no crash logs or patches involved here. The issue simply occurs when I change ivc_echo_task_write_msg((void *)rx_msg, 64) to ivc_echo_task_write_msg((void *)rx_msg, 11).
Looking forward to your reply!
Can you provide the full details about how to reproduce this issue?
- How do you think SPE FW crash, if there’s no dump log?
- What’s instructions executed to repro the issue? Please note that ivc_echo_task_write_msg will only be called when data transmitting through IVC echo channel. Simply changing that code will not have any impact on the system.
br
ChenJian
Hello!
After modifying to send 11 bytes fixedly, execute the following command on Linux:
echo tegrategrategra > /sys/devices/platform/aon_echo/data_channel
The spe will crash afterwards.
Looking forward to your reply.
you may hit a funny bug.
I made a few debugs, and it seems that the problem comes from libc/memcpy.
The corresponding part:
arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7+fp/softfp/libc.a(libc_a-memcpy.o)
0x0c497780 memcpy
With replacement of memcpy to a local_memcpy (simple implementation with C), and it can work well.
You can double-confirm in your side.
My test proves so.
br
Chenjian
Hello, are your modifications in the SPE section or the kernel section?
The issue comes from SPE side.
You can try some debug memcpy in spe-freertos-bsp/rt-aux-cpu-demo-fsp/app/ivc-echo-task.c.
Actually, any odd length, 11, 59, etc., should trigger aligned access, hence SPW FW hang.
You can replace the default memcpy with a simple C routine memcpy implementation, and it should work well.
br
ChenJian