cancel
Showing results for 
Search instead for 
Did you mean: 

VIRT_UART (or RPMsg framework) on M4 cannot send messages until A7 host sends a message.

Bumsik Kim
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Bumsik Kim
Senior

I asked about it in OpenAMP project directly and they said it is an intentional design decision.

https://github.com/OpenAMP/open-amp/issues/182

View solution in original post

1 REPLY 1
Bumsik Kim
Senior

I asked about it in OpenAMP project directly and they said it is an intentional design decision.

https://github.com/OpenAMP/open-amp/issues/182