Skip to main content
SDall
Associate III
September 24, 2023
Question

Stm32 mp1 Dev/tty/msg

  • September 24, 2023
  • 0 replies
  • 1016 views

Hi, I'm reading up on stm mp1, in particular the Linux side, my intent was to use the M4 to read data from sensors and transfer them to the A7 on the Linux side. Now I've read the function in C code that reads the messages from the manual:

 

  • read:
int readTtyRpmsg(int FdRpmsg, int len, char* pData)
{
 int byte_rd, byte_avail;
 int result = 0;
 if (FdRpmsg < 0) {
 printf("CA7 : Error reading ttyRPMSG, fileDescriptor is not set\n");
 return FdRpmsg;
 }
 ioctl(FdRpmsg, FIONREAD, &byte_avail);
 if (byte_avail > 0) {
 if (byte_avail >= len) {
 byte_rd = read(FdRpmsg, pData, len);
 } else {
 byte_rd = read(FdRpmsg, pData, byte_avail);
 }
 result = byte_rd;
 } else {
 result = 0;
 }
 return result;
}

my question if there is a way to read data with interrupt or every time I have to query this function, how do I know if the data to read in msg is available without querying the function Thank you

This topic has been closed for replies.