2019-11-07 05:26 PM
While I'm modifying the code of OpenAMP Echo, I found that VIRT_UART_Transmit() fails until host Linux sends any message (like $ echo "A" > /dev/ttyRPMSG0).
After Linux send a message everything works as expected.
After digging into it a little bit, I found that OPENAMP_send() returns RPMSG_ERR_ADDR, because huart->ept.dest_addr is set to RPMSG_ADDR_ANY when initialized in OPENAMP_create_endpoint().
When the first message received ept->dest_addr is corrected and VIRT_UART_Transmit() starts working fine: https://github.com/STMicroelectronics/STM32CubeMP1/blob/3739122ec3281ffe18356774ffc06a7fbcf6df98/Middlewares/Third_Party/OpenAMP/open-amp/lib/rpmsg/rpmsg_virtio.c#L423
I'm not sure if OpenAMP is designed like that, or a bug though. Does anyone know about this issue? If it is expected, I would like to know a proper way to send data from M4 first.
Solved! Go to Solution.
2019-11-08 12:33 AM
I asked about it in OpenAMP project directly and they said it is an intentional design decision.
2019-11-08 12:33 AM
I asked about it in OpenAMP project directly and they said it is an intentional design decision.