UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
324 Views
Registered: ‎10-01-2019

bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

I have been trying to run the open amp echo example withe linux on cpu0 and baremetal on cpu1 and i keep getting following error

remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image image_echo_test, size 2704056
remoteproc remoteproc0: bad phdr da 0x3e000000 mem 0x1af6c
remoteproc remoteproc0: Failed to load program segments: -22
remoteproc remoteproc0: Boot failed: -22
-sh: echo: write error: Invalid argument

I have modified my linkerscript system_user.dtsi /platform.h and rsc_table.c (RING_TX ,RING_RX) to match zedboard.

 Appreciate any help . Thanks!

system-user.dtsi

/include/ "system-conf.dtsi"
/ {
};
/ {
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
rproc_0_reserved: rproc@1e000000 {
no-map;
reg = <0x1e000000 0x400000>;
};

};

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

};
};

linker_script for cpu1

/* Define Memories in the system */

MEMORY
{
ps7_ddr_0_S_AXI_BASEADDR : ORIGIN = 0x1d000000, LENGTH = 0x00400000
ps7_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00030000
ps7_ram_1_S_AXI_BASEADDR : ORIGIN = 0xFFFF0000, LENGTH = 0x0000FE00
}

Platform_info.h

#ifndef PLATFORM_INFO_H_
#define PLATFORM_INFO_H_

#include <openamp/remoteproc.h>
#include <openamp/virtio.h>
#include <openamp/rpmsg.h>

#if defined __cplusplus
extern "C" {
#endif

/* SGIs */
#define SGI_TO_NOTIFY 15 /* SGI to notify the remote */
#define SGI_NOTIFICATION 14 /* SGI from the remote */

/* Memory attributes */
#define NORM_NONCACHE 0x11DE2 /* Normal Non-cacheable */
#define STRONG_ORDERED 0xC02 /* Strongly ordered */
#define DEVICE_MEMORY 0xC06 /* Device memory */
#define RESERVED 0x0 /* reserved memory */

/* Shared memory */
#define SHARED_MEM_PA 0x1e800000UL
#define SHARED_MEM_SIZE 0x80000UL
#define SHARED_BUF_OFFSET 0x80000UL

 

0 Kudos
7 Replies
Moderator
Moderator
212 Views
Registered: ‎05-10-2017

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

For 2019.2 version please use the device-tree as shown below

/ {
	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;
		rproc_0_reserved: rproc@3e000000 {
			no-map;
			reg = <0x3e000000 0x400000>;
		};
		rproc_0_dma: rproc@3e800000 {
			no-map;
			compatible = "shared-dma-pool";
			reg = <0x3e800000 0x100000>;
		};
	};
		
	remoteproc0: remoteproc@0 {
		compatible = "xlnx,zynq_remoteproc";
		firmware = "firmware";
		vring0 = <15>;
		vring1 = <14>;
		memory-region = <&rproc_0_reserved>, <&rproc_0_dma>;
	};
	
	amba {
	/* Shared memory */
		shm0: shm@0 {
			compatible = "shm_uio";
			reg = <0x0 0x3ed80000 0x0 0x1000000>;
		};
	};
};
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
165 Views
Registered: ‎10-01-2019

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

The above dtsi file helps with loading the firmware but  it ends up in kernel panic . Below is my bootlog.

root@avnet-digilent-zedboard-2019_2:~# echo image_echo_test > /sys/class/re
regulator/ remoteproc/
root@avnet-digilent-zedboard-2019_2:~# echo image_echo_test > /sys/class/remoteproc/remoteproc0/firmware
root@avnet-digilent-zedboard-2019_2:~# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image image_echo_test, size 2704056
Unable to handle kernel paging request at virtual address e16ff03a
pgd = 9e2adeca
[e16ff03a] *pgd=00000000
Unable to handle kernel paging request at virtual address e16ff03a
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
pgd = bb408558
Modules linked in:
[e16ff03a] *pgd=00000000
zynq_remoteproc
CPU: 1 PID: 1141 Comm: sh Not tainted 4.19.0-xilinx #1
Hardware name: Xilinx Zynq Platform
PC is at generic_handle_irq+0x10/0x28
LR is at __radix_tree_lookup+0x38/0xbc
pc : [<c005e768>] lr : [<c0590024>] psr: a00d0193
sp : de551d58 ip : c269eb78 fp : ddc75740
r10: ddef9000 r9 : de550000 r8 : de403600
r7 : 00000012 r6 : c269eb78 r5 : 00000000 r4 : 00000000
r3 : e16ff002 r2 : fcf0a300 r1 : 000000ff r0 : e16ff002
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
Control: 18c5387d Table: 0200804a DAC: 00000051
Process sh (pid: 1141, stack limit = 0x61a84c40)
Stack: (0xde551d58 to 0xde552000)
1d40: 00000000 c005ed18
1d60: f8f00100 c26a3ff8 de551d90 c26b3c4c f8f01100 c022da08 c0587a2c 200d0013
1d80: ffffffff de551dc4 00000000 c0009a0c e13c1b20 e0c42b40 00042470 00000000
1da0: 00000000 00000000 00000000 00000000 00000000 ddef9020 ddef9000 ddc75740
1dc0: 00000000 de551de4 00000000 c0587a2c 200d0013 ffffffff 00000051 bf000000
1de0: ddc75740 00104010 00119ce0 e0a81000 00000002 e1300000 e0a81094 c0446d10
1e00: 00119ce0 00003000 c26a6e44 e1300000 c2109900 ddef9000 ddef9020 ddc75740
1e20: 00000001 ddef9020 c2109d00 c26a6e44 ddef91b8 c04449f4 ddef9000 ddef9020
1e40: ddef91c0 00000001 ddc75740 c2109d00 c26a6e44 c0445c8c 00000000 000081a4
1e60: ddef91c8 c26a3c48 00000002 00000040 ddc75740 fcf0a300 00000000 ddd73f00
1e80: ddef9020 ddef9000 00000006 c2109090 00000051 00000004 00000000 c044644c
1ea0: 00000006 c2109080 ddd73f00 de551f78 c2109090 c014998c 00000000 00000000
1ec0: 00000006 de6df300 c0149858 00000000 c26a3c48 00529d68 00000006 c00eab48
1ee0: 00000000 00000100 0000000a c01056b0 00000000 de4700c0 0000000a de4700c0
1f00: de4700c0 0000000a de4700c0 c26a3c48 00000002 00000001 de4700c0 c26a3c48
1f20: 0000000a c00f9e98 de653100 fcf0a300 00000006 de6df300 00000006 00000000
1f40: de551f78 00529d68 00000006 c00eade8 de6df300 00529d68 00000006 de6df300
1f60: 00529d68 c26a3c48 de6df300 00529d68 00000006 c00eaf94 00000000 00000000
1f80: 00000003 fcf0a300 00000000 0000006c 00529d68 b6ef2da0 00000004 c0009204
1fa0: de550000 c0009000 0000006c 00529d68 00000001 00529d68 00000006 00000000
1fc0: 0000006c 00529d68 b6ef2da0 00000004 00000006 b6ef0b14 00000000 00000000
1fe0: 00000004 bea41950 b6e8da6b b6e1a6c6 600d0030 00000001 00000000 00000000
[<c005e768>] (generic_handle_irq) from [<c005ed18>] (__handle_domain_irq+0xa0/0xb4)
[<c005ed18>] (__handle_domain_irq) from [<c022da08>] (gic_handle_irq+0x58/0x90)
[<c022da08>] (gic_handle_irq) from [<c0009a0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xde551d90 to 0xde551dd8)
1d80: e13c1b20 e0c42b40 00042470 00000000
1da0: 00000000 00000000 00000000 00000000 00000000 ddef9020 ddef9000 ddc75740
1dc0: 00000000 de551de4 00000000 c0587a2c 200d0013 ffffffff
[<c0009a0c>] (__irq_svc) from [<c0587a2c>] (memcpy+0x4c/0x330)
[<c0587a2c>] (memcpy) from [<c0446d10>] (rproc_elf_load_segments+0xe4/0x118)
[<c0446d10>] (rproc_elf_load_segments) from [<c04449f4>] (rproc_start+0x24/0x1e4)
[<c04449f4>] (rproc_start) from [<c0445c8c>] (rproc_boot+0x250/0x4a8)
[<c0445c8c>] (rproc_boot) from [<c044644c>] (state_store+0x40/0xb8)
[<c044644c>] (state_store) from [<c014998c>] (kernfs_fop_write+0x134/0x1a4)
[<c014998c>] (kernfs_fop_write) from [<c00eab48>] (__vfs_write+0x28/0x154)
[<c00eab48>] (__vfs_write) from [<c00eade8>] (vfs_write+0xb8/0x144)
[<c00eade8>] (vfs_write) from [<c00eaf94>] (ksys_write+0x4c/0x9c)
[<c00eaf94>] (ksys_write) from [<c0009000>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xde551fa8 to 0xde551ff0)
1fa0: 0000006c 00529d68 00000001 00529d68 00000006 00000000 +-----------------------------+
1fc0: 0000006c 00529d68 b6ef2da0 00000004 00000006 b6ef0b14 00000000 00000000 | |
1fe0: 00000004 bea41950 b6e8da6b b6e1a6c6 | Cannot open /dev/ttyACM0! |
Code: e92d4010 ebfffff9 e2503000 0a000003 (e5933038) | |
Internal error: Oops - BUG: 5 [#2] PREEMPT SMP ARM +-----------------------------+
---[ end trace 6b4b65fe76cbb022 ]---
Kernel panic - not syncing: Fatal exception in interrupt
Modules linked in: zynq_remoteproc
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G D 4.19.0-xilinx #1
Hardware name: Xilinx Zynq Platform
PC is at generic_handle_irq+0x10/0x28
LR is at __radix_tree_lookup+0x38/0xbc
pc : [<c005e768>] lr : [<c0590024>] psr: a00e0193
sp : c26a1eb8 ip : 0035f1a9 fp : 00000011
r10: 00000011 r9 : c26a0000 r8 : de403600
r7 : 00000012 r6 : c269eb78 r5 : 00000000 r4 : 00000000
r3 : e16ff002 r2 : fcf0a300 r1 : 000000ff r0 : e16ff002
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
Control: 18c5387d Table: 0200404a DAC: 00000051
Process swapper/0 (pid: 0, stack limit = 0x0169d8c6)
Stack: (0xc26a1eb8 to 0xc26a2000)
1ea0: 00000000 c005ed18
1ec0: f8f00100 c26a3ff8 c26a1ef0 c26b3c4c f8f01100 c022da08 c04108b0 600e0013
1ee0: ffffffff c26a1f24 8848daee c0009a0c 00000000 00000011 1c530000 00000000
1f00: debce478 ffffe000 debce478 00000000 8848daee 88da762a 00000011 00000011
1f20: fffffff5 c26a1f40 c0410888 c04108b0 600e0013 ffffffff 00000051 00000000
1f40: 0091ec61 00000000 000000ff 00000000 debce6bc debce478 ffffe000 c26c9730
1f60: 00000001 c26a3c6c c26a3ca8 c269e470 00000000 c0047150 defffe00 c26a3c48
1f80: 006a1f94 fcf0a300 ffffe000 000000c5 c26d3440 ffffffff c26a3c48 c26a3c40
1fa0: defffe00 c0794a38 00000000 c004733c c26d3498 c0761c0c ffffffff ffffffff
1fc0: 00000000 c076158c 00000000 c0794a38 fcf4b000 00000000 c0761330 00000051
1fe0: 10c0387d 00000000 08008000 413fc090 18c5387d 00000000 00000000 00000000
[<c005e768>] (generic_handle_irq) from [<c005ed18>] (__handle_domain_irq+0xa0/0xb4)
[<c005ed18>] (__handle_domain_irq) from [<c022da08>] (gic_handle_irq+0x58/0x90)
[<c022da08>] (gic_handle_irq) from [<c0009a0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xc26a1ef0 to 0xc26a1f38)
1ee0: 00000000 00000011 1c530000 00000000
1f00: debce478 ffffe000 debce478 00000000 8848daee 88da762a 00000011 00000011
1f20: fffffff5 c26a1f40 c0410888 c04108b0 600e0013 ffffffff
[<c0009a0c>] (__irq_svc) from [<c04108b0>] (cpuidle_enter_state+0xf8/0x1d8)
[<c04108b0>] (cpuidle_enter_state) from [<c0047150>] (do_idle+0x1ac/0x23c)
[<c0047150>] (do_idle) from [<c004733c>] (cpu_startup_entry+0x18/0x1c)
[<c004733c>] (cpu_startup_entry) from [<c0761c0c>] (start_kernel+0x34c/0x3c4)
Code: e92d4010 ebfffff9 e2503000 0a000003 (e5933038)
---[ end trace 6b4b65fe76cbb023 ]---
SMP: failed to stop secondary CPUs
---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---

0 Kudos
Moderator
Moderator
154 Views
Registered: ‎05-10-2017

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

Are you using the prebuilt echo-test application or have you built it using Vitis?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
117 Views
Registered: ‎10-01-2019

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

I have used prebuilt echo-test  for above error. Trying openamp-echo with vitis I get the same kernel panic message as prebuilt echo test

When i try to load the one built with Vitis  with rpc_demo i get

root@avnet-digilent-zedboard-2019_2:~# echo test.elf > /sys/class/remoteproc/remoteproc0/firmware
root@avnet-digilent-zedboard-2019_2:~# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image test.elf, size 2700912
remoteproc remoteproc0: Boot failed: -22
-sh: echo: write error: Invalid argument

I have tried going the yocto route adding meta-openamp layer . I get the this error

root@zedboard-zynq7:~# echo openamp.elf > /sys/class/remoteproc/remoteproc0/firmware
root@zedboard-zynq7:~# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image openamp.elf, size 2719840
zynq_remoteproc remoteproc@0: Bad carveout rsc configuration
remoteproc remoteproc0: Unable to allocate carveout vdev0vring0: -12
remoteproc remoteproc0: Failed to allocate associated carveouts: -12
remoteproc remoteproc0: Boot failed: -12
-sh: echo: write error: Cannot allocate memory

Tried to follow UG1186 page 44 instructions to assign RING_TX from FW_RSC_U32_ADDR_ANY to 0x3e800000 and RING_RX from FW_RSC_U32_ADDR_ANY to 0x3e840000

Thanks !

0 Kudos
Moderator
Moderator
73 Views
Registered: ‎05-10-2017

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

You don't need to do those changes in vitis. Those are for zynqmp platform and rpmsg in linux userspace.

For zynq7000, you will need to follow the section starting from page 30. The only change when you build the application in Vitis is -DUSE_AMP=1 flag that must be added.

Also you can enable the default images in petalinux by doing petalinux-config -c rootfs


Filesystem Packages --->
misc --->
openamp-fw-echo-testd --->
[*] openamp-fw-echo-testd
openamp-fw-mat-muld --->
[*] openamp-fw-mat-muld
openamp-fw-rpc-demo --->
[*] openamp-fw-rpc-demo

This will get included in /lib/firmware and then you can run image_echo_test

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
50 Views
Registered: ‎10-01-2019

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

I have already enabled them in rootfs and i see them installed in lib/firmware as shown below

root@avnet-digilent-zedboard-2019_2:/lib/firmware# ls
image_echo_test image_matrix_multiply image_rpc_demo openamp.elf

As for vitis I have set the complier to use -DUSE_AMP=1

0 Kudos
41 Views
Registered: ‎10-01-2019

Re: bad phdr da 0x3e000000 mem 0x1af6c when loading remote app for zedboard

All the examples fail with same kernel panic

Unable to handle kernel paging request at virtual address 55b7ff5c

Unable to handle kernel paging request at virtual address 55b7ff5c

pgd = 27b6cb6a

pgd = 27b6cb6a

[55b7ff5c] *pgd=00000000

[55b7ff5c] *pgd=00000000

Internal error: Oops - BUG: 80000005 [#1] PREEMPT SMP ARM

0 Kudos