cancel
Showing results for 
Search instead for 
Did you mean: 

Why num_of_vrings is set to 0 if I start M4 code with spl and why is it set to 2 when I start code with linux?

ASega.1
Associate III

Hi,

I'm using stm32mp153c and I managed to start M4 code after the SPL initialization and before U-BOOT. All initializations work fine except for the MX_OPENAMP_Init.

I see that if I start the code after SPL the variable of num_of_vrings (that is equal to the define VRING_COUNT 2) is 0. Whereas if I start the M4 code directly from linux the variable is set to 2 and the OPENAMP initialization works.

I tried to set a delay of 1 minute before the IPCC and OPENAMP initializations (in order to wait for LINUX to enable virt_uart and rpmsg_sdb devices) but the OPENAMP initialization still failed.

Any suggestions?

Thanks in advance.

Best regards,

Andrea

1 REPLY 1
ArnaudP
Senior

Hello,

Look like that you don't load the .resource_table section in memory, or that the SPL does not provide the address to the Linux.

1 ) Do you fill the backup/tamp registers to provide the M4 state and resource table address information to the Linux?

cf U-boot code here:https://elixir.bootlin.com/u-boot/latest/source/drivers/remoteproc/stm32_copro.c#L149

2) if done first check in Linux console that the remoteproc is in "detached" state

 root@stm32mp15-disco-oss:~# cat /sys/class/remoteproc/remoteproc0/state
 detached

 3) attach it

root@stm32mp15-disco-oss:~# echo start >/sys/class/remoteproc/remoteproc0/state
root@stm32mp15-disco-oss:~# cat /sys/class/remoteproc/remoteproc0/state
attached