cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wicky_waka
Visitor
Visitor
1,128 Views
Registered: ‎04-15-2019

Running openAMP example give error Failed to find resource table

Hello everyone,

I am trying to run the OpenAMP examples from Xilinx on my ZedBoard. I enabled all the openAMP features on the Linux side, update the system-user.dtsi with openamp-overlay.dts and updated the after that. Then I created a new application in Xilinx SDK and selected the Zedboard hardware and OpenAMP example as template. I added the -DUSE_AMP=true to extra compilers flags and followed the UG1186 (v2017.2) OpenAMP Framework for Zynq Devices.

I then copied the compiled elf file to the /lib/firmware directory on the zedboard and tried to run it using the following commands and get the error also shown below:

root@avnet-digilent-zedboard-2017_2:/lib/firmware# echo mat_mul_demo > /sys/class/remoteproc/remoteproc0/firmware 
root@avnet-digilent-zedboard-2017_2:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state 
remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image mat_mul_demo, size 6724
remoteproc remoteproc0: Failed to find resource table
remoteproc remoteproc0: Boot failed: -22
-sh: echo: write error: Invalid argument

I am trying to wrap my head around the resource table but would appreciate any help from you guys if you know what might be the problem. I attached the files I think would be related.

 

Cheers.

Waqar Rashid

 

P.S can't attach the system-user.dtsi due to some reason so here it goes:

 

/include/ "system-conf.dtsi"
/ {
	amba {
                elf_ddr_0: ddr@0 {
                        compatible = "mmio-sram";
                        reg = <0x100000 0x100000>;
                };

	};

	remoteproc0: remoteproc@0 {
		compatible = "xlnx,zynq_remoteproc";
		firmware = "firmware";
		vring0 = <15>;
		vring1 = <14>;
		sram_0 = <&elf_ddr_0>;

	};

};

 

Update 1:

One thing which I doubt is the reason is mentiond like this in the OpenAMP Framkework docs:

For the RSC_RPROC_MEM resource, the Linux kernel remoteproc allocates shared memory for vrings and RPMsg buffers from the memory specified in this resource. If you do not specify this resource in the resource table, the Linux side will allocate the memory from its system memory. If you specify it in the resource table, it must be inside the range defined by the DTS reserved-memory section for rproc. It should not overlap its address with the memory nodes in the device tree which are used to load the firmware.

 

Update 2:

I changed the RSC_RPROC_MEM so that it falls inside the elf_ddr_0 but now it gives the following error:

I changed the RSC_RPROC_MEM so that it falls inside the elf_ddr_0 but now it gives the following error:
root@avnet-digilent-zedboard-2017_2:/lib/firmware# echo mat_mul > /sys/class/remoteproc/remoteproc0/firmware 
root@avnet-digilent-zedboard-2017_2:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image mat_mul, size 513912
remoteproc remoteproc0: failed to declare rproc mem as DMA mem.
remoteproc remoteproc0: Failed to declare rproc memory resource: -12
remoteproc remoteproc0: Boot failed: -12
-sh: echo: write error: Cannot allocate memory

 

Update 3: 

Due to some reason, the linker scripts of openamp example templates in Xilinx SDK does not make the .resource_table section the ELF loader is looking for. So I added one by following the advice of Henery Choi  by adding the following to the lscript.ld:

.resource_table : {
   __rtable_start = .;
   *(.rtable)
   __rtable_end = .;
} > ps7_ddr_0_S_AXI_BASEADDR

After this I compiled the application and tried to run it. It did ran for a while until it froze and the remoteproc was unsable after that. I had to reboot. So there may be some other memory address related problems but this one is solved, I think. more updates coming.

 

0 Kudos
0 Replies