How to start remoteproc module on colibri VF61

I have updated my VF61 with latest u-boot image (2015.04+fslc+g46aa70c (Sep 29 2016 - 21:58:20)) and latest kernel (Angstrom v2015.12 - Kernel 4.4.21, Colibri_VF_LinuxConsoleImageV2.6.1_20161001).

Before updating linux on Colibri VF61, I compiled it with all modules (along with remoteproc) and also followed the steps to deploys latest compiled kernel modules and then I prepared SD card to update the image on Colibri -VF61. I used following command on U-boot to load the new image with all modules.

run setupdate
run prepare_ubi
run update_fdt
run update_kernel

After rebooting the board, there was no remoteproc modules loaded. I also created vf610_cm4_rproc.conf file manually in /etc/module-load.d directory. Nothing helps.

Is there any specific way to load remoteproc module. Very poor documentation. I am trying to run simple hello_world program from linux from last three weeks but none of documentation is working.

Is there anyone who made it working on colibri-VF61?

How about following this article on our developer website using our latest BSP demo image?

If you are using our 2.6.1 release image, there is no requirement of compiling modules or the kernel. If you flashed the 2.6.1 console image, do you have the exact following output?

root@colibri-vf:~# cat /etc/issue                                                                                         
.---O---.                                           
|       |                  .-.           o o        
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution \n \l

Angstrom v2015.12 - Kernel \r

Colibri_VF_LinuxConsoleImageV2.6.1_20161001

root@colibri-vf:~# ls /lib/modules/4.4.21-v2.6.1b1+g7ecc29c/kernel/drivers/remoteproc/
remoteproc.ko       vf610_cm4_rproc.ko
root@colibri-vf:~# ls /lib/modules/4.4.21-v2.6.1b1+g7ecc29c/kernel/drivers/rpmsg/     
imx_rpmsg_pingpong.ko  imx_rpmsg_tty.ko       vf610_rpmsg.ko         virtio_rpmsg_bus.ko

Do you have the hello_world.elf placed in /lib/firmware and soft linked to freertos-rpmsg.elf?

root@colibri-vf:/lib/firmware# ls -lah
drwxr-xr-x    3 root     root        1.2K Nov 17 12:47 .
drwxr-xr-x    9 root     root        6.8K Nov 17 12:40 ..
-rw-r--r--    1 root     root        2.1K Sep 27 12:03 LICENCE.ralink-firmware.txt
-rw-r--r--    1 root     root        2.1K Sep 27 12:03 LICENCE.rtlwifi_firmware.txt
lrwxrwxrwx    1 root     root          15 Nov 17 12:47 freertos-rpmsg.elf -> hello_world.elf
-rwxr-xr-x    1 root     root      255.4K Nov 17 12:46 hello_world.elf
root@colibri-vf:/lib/firmware# ls -lah
drwxr-xr-x    3 root     root        1.2K Nov 17 12:47 .
drwxr-xr-x    9 root     root        6.8K Nov 17 12:40 ..
-rw-r--r--    1 root     root        2.1K Sep 27 12:03 LICENCE.ralink-firmware.txt
-rw-r--r--    1 root     root        2.1K Sep 27 12:03 LICENCE.rtlwifi_firmware.txt
lrwxrwxrwx    1 root     root          15 Nov 17 12:47 freertos-rpmsg.elf -> hello_world.elf
-rwxr-xr-x    1 root     root      255.4K Nov 17 12:46 hello_world.elf
<snip>

Is the remoteproc conf file placed correctly in /etc/modules-load.d?

root@colibri-vf:/etc/modules-load.d# ls
libcomposite.conf     vf610_cm4_rproc.conf  vf610_rpmsg.conf
root@colibri-vf:/etc/modules-load.d# cat vf610_cm4_rproc.conf 
vf610_cm4_rproc
root@colibri-vf:/etc/modules-load.d# ls
libcomposite.conf     vf610_cm4_rproc.conf  vf610_rpmsg.conf
root@colibri-vf:/etc/modules-load.d# cat vf610_cm4_rproc.conf 
vf610_cm4_rproc

Are the u-boot environment variables fdt_fixup and defargs correctly set as described here?

If all the above is in place you should see hello world on UART2 automatically as Linux boots up. Here are the relevant messages from my boot up here.

The Angstrom Distribution colibri-vf ttyLP0
Angstrom v2015.12 - Kernel 4.4.21-v2.6.1b1+g7ecc29c
Colibri_VF_LinuxConsoleImageV2.6.1_20161001                                     
colibri-vf login: root
Last login: Thu Nov 17 12:53:42 UTC 2016 on ttyLP0                                                                         
root@colibri-vf:~# dmesg | grep -i "rpmsg"
[    5.119465]  remoteproc0: Booting fw image freertos-rpmsg.elf, size 261508
[    5.198118] vf610 rpmsg driver is registered.
[    7.068389] virtio_rpmsg_bus virtio0: rpmsg host is online
root@colibri-vf:~# dmesg | grep -i "remoteproc"
[    4.937644]  remoteproc0: vf610_m4 is available
[    4.949889]  remoteproc0: Note: remoteproc is still under development and considered experimental. 
[    4.973632]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[    5.051568]  remoteproc0: powering up vf610_m4
[    5.119465]  remoteproc0: Booting fw image freertos-rpmsg.elf, size 261508
[    5.133942]  remoteproc0: No resource table found, continuing...
[    5.147655]  remoteproc0: remote processor vf610_m4 is now up
root@colibri-vf:~# 

Thank you for detailed information. I was missing to set u-boot environment variables fdt_fixup and defargs. Actually I was using those variables for starting cortex-M4 firmware from u-boot.

Starting M4 firmware from u-boot and using Linux with remoteproc are two orthogonal approaches. Both of them cannot be used at the same time, only one method should be used.

That’s correct. I meant I was trying uboot method first and it was working fine and then I am trying Linux method.