IMX8MPlus-RPMsg- Linux Code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IMX8MPlus-RPMsg- Linux Code

197 次查看
ramesh91720721
Contributor I

HI , 

I managed to run the sample code with the RPMsg Pingpong example. 

I am trying to incorporate the Reading the data from my application . 

Is there any sample to achieve it. 

Thanks,

Ramesh.

 

 

 

0 项奖励
回复
2 回复数

67 次查看
ramesh_rajagopal
Contributor I

Daniel, 

Thanks, It worked. Solved the problem. 

 

 

0 项奖励
回复

123 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi @ramesh91720721 

 

On the A-core (Linux) side.  Once the RPMsg channel is establised between  core A (Linux) and Cortex-M (RTOS), you can assess it via a character device.   /dev/ttyPRMSG0

You can use the standard Linux file (open, read, write)

For example,   

 

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>

 

int main() {
    int fd = open("/dev/ttyRPMSG0", O_RDONLY);
    if (fd < 0) {
        perror("Failed to open RPMsg device");
        return -1;
    }

 

    char buffer[128];
    while (1) {
        int len = read(fd, buffer, sizeof(buffer) - 1);
        if (len > 0) {
            buffer[len] = '\0';
            printf("Received: %s\n", buffer);
        }
    }

 

    close(fd);
    return 0;
}

 

Any support, information, and technology (“Materials”) provided by NXP are provided AS IS, without any warranty express or implied, and NXP disclaims all direct and indirect liability and damages in connection with the Material to the maximum extent permitted by the applicable law. NXP accepts no liability for any assistance with applications or product design.  Materials may only be used in connection with NXP products. Any feedback provided to NXP regarding the Materials may be used by NXP without restriction.

 

 

Regards

Daniel