04-04-2019 04:40 PM - edited 04-15-2019 08:36 AM
Hi, I'm trying to get the echo example from the tech manual UG 1186 to run correctly on the ZynqMP. I'm running Linux on the A53 and bare metal on the R5. I do not want to use remote proc to load the firmware, but instead I want to use the FSBL to run in userspace. I'm using xSDK version 2018.3 and Petalinux Tools version 2018.3. I've successfully created the R5 firmware using the SDK project template in Eclipse and saved it to images/linux/r5-echo with the rest of the Petalinux artifacts. The linker script is as follows:
MEMORY { psu_ddr_S_AXI_BASEADDR : ORIGIN = 0x3ED00000, LENGTH = 0x00040000 psu_ocm_ram_1_S_AXI_BASEADDR : ORIGIN = 0xFFFF0000, LENGTH = 0x00010000 psu_r5_tcm_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00010000 psu_r5_tcm_ram_1_S_AXI_BASEADDR : ORIGIN = 0x00020000, LENGTH = 0x00010000 }
I added 0x20000 to the size of psu_ddr_S_AXI_BASEADDR per the UG1186 instructions. I also include the resource_table section:
.resource_table 0x3ed20000 : { . = ALIGN(4); *(.resource_table) } > psu_ddr_S_AXI_BASEADDR
The following was added to the dts:
/ { reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; rproc_0_reserved: rproc@3ed000000 { no-map; reg = <0x0 0x3ed00000 0x0 0x1000000>; }; };
amba { vring: vring@0 { compatible = "vring_uio"; reg = <0x0 0x3ed40000 0x0 0x40000>; };
/* Shared memory (APU to RPU) */ shm0: shm@0 { compatible = "shm_uio"; reg = <0x0 0x3ed20000 0x0 0x0100000>; };
/* IPI device */ ipi0: ipi@0 { compatible = "ipi_uio"; reg = <0x0 0xff340000 0x0 0x1000>; interrupt-parent = <&gic>; interrupts = <0 29 4>; }; }; };
I selected the libsysfs, libmetal, open-amp, and open-amp-demos from the menu when I ran
petalinux-config -c rootfs
To load the R5 firmware, I used the xSDK to create a boot image using the following .bif:
the_ROM_image: { [bootloader, destination_cpu=a53-0] images/linux/zynqmp_fsbl.elf [destination_device=pl] images/linux/system.bit [destination_cpu=pmu] images/linux/pmufw.elf [destination_cpu=r5-0] images/linux/r5-echo.elf [destination_cpu=a53-0, exception_level=el-3, trustzone]images/linux/bl31.elf [destination_cpu=a53-0, exception_level=el-2] images/linux/u-boot.elf }
When the system starts, I see the familiar print out from the R5 app:
Starting application... Initialize remoteproc successfully. creating remoteproc virtio initializing rpmsg shared buffer pool initializing rpmsg vdev
The system seems to start up fine and the UIO kernel module gets loaded. When I execute the app, I get the following on the console:
root@petalinux:/# rpmsg-echo-ping-shared metal: info: metal_uio_dev_open: No IRQ for device 3ed20000.shm. Successfully open shm device. Successfully added shared memory Successfully probed IPI device Successfully initialized Linux r5 remoteproc. Successfully initialized remoteproc Calling mmap resource table. Successfully mmap resource table. Failed to intialize remoteproc Failed to create remoteproc device. ERROR: Failed to initialize platform.
Stopping application...
What am I doing wrong? The binaries are built using the menus in both Petalinux and the xSDK yet the OpenAMP example still fails to run. Any help is greatly appreciated.
10-03-2019 11:07 AM
@kashraf wrote:
Where you able to run it?
It crashes when it starts the demo, but I can see the print outs at the beginning and I have stepped through the code until it starts invoking OpenAMP calls.
------------------
This post is closed even though it is not solved. We have elected to not use OpenAMP / libmetal and instead program the IPI directly via the registers and interrupts--it's much quicker than trying to find a solution to the problem.
04-11-2019 10:19 AM
Hi,
Are you sure you are using the 2018.3 template for echo-test for R5.
When the application starts you should see this
Starting application...
Initialize remoteproc successfully.
creating remoteproc virtio
initializing rpmsg shared buffer pool
initializing rpmsg vdev
You can verify this by looking at the source code
https://github.com/Xilinx/open-amp/tree/xilinx-v2018.3/apps/machine/zynqmp_r5
04-15-2019 08:32 AM
You are correct and that's what appears at boot time. I did not copy and paste the ouput when booting as I didn't have access to the board when I posted. The user app output, however, is as I've written it above.
For an update, I used the xSDK and stepped through the code when running on Linux. It appears the failure occurs when the app calls remoteproc_set_rsc_table(). That's as far as I've taken it since it seems the issue goes much deeper into OpenAMP itself.
09-27-2019 04:59 AM
10-03-2019 11:07 AM
@kashraf wrote:
Where you able to run it?
It crashes when it starts the demo, but I can see the print outs at the beginning and I have stepped through the code until it starts invoking OpenAMP calls.
------------------
This post is closed even though it is not solved. We have elected to not use OpenAMP / libmetal and instead program the IPI directly via the registers and interrupts--it's much quicker than trying to find a solution to the problem.