Skip to main content
Visitor II
November 8, 2019
Solved

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

  • November 8, 2019
  • 1 reply
  • 1919 views

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.

    This topic has been closed for replies.
    Best answer by Bumsik Kim

    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

    1 reply

    Bumsik KimAuthorAnswer
    Visitor II
    November 8, 2019

    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