IMX8MPlus-RPMsg- Linux Code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX8MPlus-RPMsg- Linux Code

195件の閲覧回数
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 返答(返信)

65件の閲覧回数
ramesh_rajagopal
Contributor I

Daniel, 

Thanks, It worked. Solved the problem. 

 

 

0 件の賞賛
返信

121件の閲覧回数
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