Skip to main content
AShva.1
Associate III
February 9, 2020
Solved

Can't open /dev/ttyRPMSG0 :(

  • February 9, 2020
  • 8 replies
  • 2418 views

I'm trying execution code:

#define DEVICE "/dev/ttyRPMSG0"
 
int main(void)
{
 int fd;
 struct termios tty;
 char buf[100];
 int len;
 
 printf("Opening device...\n");
 fd = open( DEVICE, O_RDWR | O_NOCTTY | O_NDELAY ); // read/write, no console, no delay
 if ( fd < 0 )
 {
 printf("Error, cannot open device\n");
 return 1;
 }
}

But, always get: Error, cannot open device. :(

I think, that in my Linux system there is no driver for this device: /dev/ttyRPMSG0.

What am I doing wrong?

How to create and manage a device /dev/ttyRPMSG0 from a program correctly?

Board: STM32MP157C-DK2

Many thanks.

This topic has been closed for replies.
Best answer by nick67

Hi AShva.1,

let me share with you the two projects attached to this message (they are compressed in a single zip file).

One runs on Cortex-A7 and the other on Cortex-M4.

Virtual UART is created in Cortex-M4 project, in the main.c file.

0690X00000D8vfEQAR.png

Then, in Cortex-M7 project you can find the connection from A7 processor to the Virtual UART created before from M4 processor:

0690X00000D8vfYQAR.png

The full application aims to build a user interface on the LCD touch screen via GtkBuilder on Cortex-A7.

Then you'll obtain three graphic buttons that, once pressed, send a message through IPCC to the Cortex-M4.

This one receives the message, decode it and toggles the related LED:

0690X00000D8vg2QAB.png

Please note that in this project first the Cortex-M4 has to create the virtual UART and then the Cortex-A7 can connect to this UART.

Hope it could be useful.

Regards

Nicola

8 replies

nick67
nick67Answer
Associate
February 9, 2020

Hi AShva.1,

let me share with you the two projects attached to this message (they are compressed in a single zip file).

One runs on Cortex-A7 and the other on Cortex-M4.

Virtual UART is created in Cortex-M4 project, in the main.c file.

0690X00000D8vfEQAR.png

Then, in Cortex-M7 project you can find the connection from A7 processor to the Virtual UART created before from M4 processor:

0690X00000D8vfYQAR.png

The full application aims to build a user interface on the LCD touch screen via GtkBuilder on Cortex-A7.

Then you'll obtain three graphic buttons that, once pressed, send a message through IPCC to the Cortex-M4.

This one receives the message, decode it and toggles the related LED:

0690X00000D8vg2QAB.png

Please note that in this project first the Cortex-M4 has to create the virtual UART and then the Cortex-A7 can connect to this UART.

Hope it could be useful.

Regards

Nicola

AShva.1
AShva.1Author
Associate III
February 10, 2020

Nicola!

thank you very much!!!

I will do and write...

Best regards

Alexander.

AShva.1
AShva.1Author
Associate III
February 11, 2020

Nicola!

I'm trying import project cortex_M4-hrdbtn_IPCC to System Workbech for STM32 IDE.

Very much errors :(

Please, write me, how to do it right.

Best regards

Alexander.

operating system: Ubuntu 16.04

nick67
Associate
February 11, 2020

Hi Alexander,

my fault. I didn't remember to mention that the projects are for STM32CubeIDE 1.2.0

You can download it from this page:

https://www.st.com/en/development-tools/stm32cubeide.html

Best regards

Nicola

operating system : XUbuntu 18.04

AShva.1
AShva.1Author
Associate III
February 12, 2020

Hi Nicola!

Thank you!

I will try. :)

Best regards

Alexander.

AShva.1
AShva.1Author
Associate III
February 12, 2020

Hi, Nicola!

Many thanks.

Your project works great. :)

I have a few new questions:

  1. How to organize a transmission channel from M4 to A7?
  2. Can i use OPENAMP without HAL?

I would be very happy if you provide examples. :)

Best regards

Alexander.

nick67
Associate
February 12, 2020

Hi, Alexander.

I'm glad to hear that the project works for you.

Unfortunately I didn't develop any more this kind of application so I can't provide other examples about IPCC :worried_face:

My first attempts started with the project OpenAMP_TTY_echo (attached here for your convenience) from STM32Cube_FW_MP1_V1.1.0 : https://wiki.st.com/stm32mpu/wiki/Install_STM32Cube_MP1_package

Lately I'm trying to have a better understanding of ADC management, peripheral sharing between CA7 and CM4 and Device Tree usage in OpenSTLinux.

Best regards

Nicola

AShva.1
AShva.1Author
Associate III
February 13, 2020

Hi, Nicola!

I understood you.

Many thanks for the help.

Best regards

Alexander.