Problem loading RPMsg TTY Example on colibri imx7

Hi,

I am trying to use M4 core, but facing some issues.
When is do modprobe i am not able to see anything

root@colibri-imx7-emmc:~# modprobe imx_rpmsg_tty
root@colibri-imx7-emmc:~# 

My kernel

root@colibri-imx7-emmc:~# uname -a
Linux colibri-imx7-emmc 4.1.44-00001-gdd5a082f1307-dirty #5 SMP Thu Aug 8 15:32:41 IST 2019 armv7l GNU/Linux

From M4 side i am getting this on UARTB

RPMSG String Echo FreeRTOS RTOS API Demo...
RPMSG Init as Remote

It would be great if someone could help me out.

You are using very old BSP version. The imx_rpmsg_tty is not included at that BSP. Please update to the latest v.2.8 BSP .

Hi @alex.tx ,
Thank you, i will try with the latest BSP.

Hi @alex.tx .

i have updated the kernel , but same result.

root@colibri-imx7-emmc:~# modprobe imx_rpmsg_tty
root@colibri-imx7-emmc:~# uname -a
Linux colibri-imx7-emmc 4.9.166 #1 SMP Fri Aug 9 10:07:16 IST 2019 armv7l GNU/Linux

hi @abhilash: Did you try this?

hi,
Yes i tried that one only.

I am getting this error when compiling kernel with this option
<*> RPMSG device interface

make -j3 zImage
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GZIP    kernel/config_data.gz
  CHK     kernel/config_data.h
  UPD     kernel/config_data.h
  CC      kernel/configs.o
  LD      kernel/built-in.o
  CC      drivers/rpmsg/rpmsg_char.o
drivers/rpmsg/rpmsg_char.c: In function 'rpmsg_eptdev_poll':
drivers/rpmsg/rpmsg_char.c:272:10: error: implicit declaration of function 'rpmsg_poll' [-Werror=implicit-function-declaration]
  mask |= rpmsg_poll(eptdev->ept, filp, wait);
          ^~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:304: recipe for target 'drivers/rpmsg/rpmsg_char.o' failed
make[2]: *** [drivers/rpmsg/rpmsg_char.o] Error 1
scripts/Makefile.build:555: recipe for target 'drivers/rpmsg' failed
make[1]: *** [drivers/rpmsg] Error 2
Makefile:1022: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Which kernel branch are you using?
Could you provide your kernel .config?
Thanks

Hi,
Kernel branch

~/toradex/new-linux/linux-toradex$ git branch 
* toradex_4.9-2.3.x-imx

Config file

hi, Yes i tried that one only.

So, is there any error?

Regarding the compilation error above, you can compile this option as a module. This works fine for me.

Hi,
The problem is i am not able to get rpmsg to work.
There is no /dev/ttyRPMsg. Do we need rpmsg_char for imx_rpmsg_tty to work?

 root@colibri-imx7-emmc:~# modprobe imx_rpmsg_tty
 root@colibri-imx7-emmc:~# uname -a
 Linux colibri-imx7-emmc 4.9.166 #1 SMP Fri Aug 9 10:07:16 IST 2019 armv7l GNU/Linux

But making " RPMSG device interface " as module also gives error

~/toradex/new-linux/linux-toradex$ make -j3 modules
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC [M]  drivers/rpmsg/rpmsg_char.o
drivers/rpmsg/rpmsg_char.c: In function 'rpmsg_eptdev_poll':
drivers/rpmsg/rpmsg_char.c:272:10: error: implicit declaration of function 'rpmsg_poll' [-Werror=implicit-function-declaration]
  mask |= rpmsg_poll(eptdev->ept, filp, wait);
          ^~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:310: recipe for target 'drivers/rpmsg/rpmsg_char.o' failed
make[2]: *** [drivers/rpmsg/rpmsg_char.o] Error 1
scripts/Makefile.build:555: recipe for target 'drivers/rpmsg' failed
make[1]: *** [drivers/rpmsg] Error 2
Makefile:1022: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Hi @abhilash

No, you don’t need rpmsg_char for imx_rpmsg_tty to work.

But making " RPMSG device interface " as module also gives error

You are right. Sorry I forgot to make the modules. This is a bug. We will look into this and come back to you.

Concerning your issue with Rpmsg, I tested it on regular Bsp2.8b6 without any kernel changes and it is working for me.

root@colibri-imx7-emmc:~# modprobe imx_rpmsg_tty
[   31.763473] imx_rpmsg_tty virtio0.rpmsg-openamp-demo-channel.-1.0: new channel: 0x400 -> 0x0!
[   31.772395] Install rpmsg tty driver!
root@colibri-imx7-emmc:~# ls /dev | grep -i rpmsg
ttyRPMSG0

Could you describe the steps you have done?

Thanks and best regards,
Jaski

Hi @abhilash

Perfect that it works. Thanks for the feedback.

Best regards,
Jaski

Hi,
Its now working for me.
I was using the binaries from this link.

https://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/FreeRTOS/Binaries/

These binaries wont work. Rpmsg is working on old 4.1 kernel as well.