Remoteproc faild to load program

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Remoteproc faild to load program

2,390 次查看
raveen
Contributor II

Hi,

I tried to boot IMX7 M4 rtso demo firmware via remoteproc, but remoteproc failed with the following errors

[ 231.254433] remoteproc remoteproc0: powering up imx-rproc
[ 231.323519] remoteproc remoteproc0: Booting fw image rpmsg_rtos_ddr.axf, size 1311480
[ 231.323573] remoteproc remoteproc0: No resource table in elf
[ 231.323671] imx-rproc imx7d-cm4: Translation failed: da = 0x1fff0000 len = 0x8240
[ 231.323683] remoteproc remoteproc0: bad phdr da 0x1fff0000 mem 0x8240
[ 231.323693] remoteproc remoteproc0: Failed to load program segments: -22
[ 231.323990] remoteproc remoteproc0: Boot failed: -22

It seems, remoteproc tries to load firmware at the address 0x1fff0000 from the binary's program header, which is not reserved in the device tree as well as in the linker file. But the section header has proper address segments.

Binary header:

Screenshot from 2023-04-03 19-59-37.png

 

Is there any way to make remoteproc driver use the section header? or did I miss anything in the device tree or linker script? Can anyone help me to resolve this issue?

here are my device tree changes,

memory {
		linux,usable-memory = <0x81000000 0x1f000000>,
			<0xa0000000 0x1ff00000>;
	};

	reserved-memory {
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

		m4_ddr_reserved: cm4_ddr@80000000 {
 			reg = <0x80000000 0x100000>;
 			no-map;
 		};

		m4_ddr_audio_reserved: cm4_ddr_audio@9ff00000 {
			reg = <0x9ff00000 0x100000>;
			no-map;
		};

		m4_tcm_l_reserved: m4_tcm_l@1FFF8000 {
			reg = <0x1FFF8000 0x8000>;
			no-map;
		};

		m4_tcm_h_reserved: m4_tcm_h@20000000 {
			reg = <0x20000000 0x8000>;
			no-map;
		};

		m4_ocram_reserved: m4_ocram@20201000 {
			reg = <0x20201000 0x1FFFE>;
			no-map;
		};
	};

	imx7d-cm4 {
 		compatible = "fsl,imx7d-cm4";
 		syscon = <&src>;
 		clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>;
		memory-region = <&m4_ddr_reserved>, <&m4_ddr_audio_reserved>, <&m4_tcm_l_reserved>, <&m4_tcm_h_reserved>, <&m4_ocram_reserved>;
 	};

Memory segment in the linker file

/* Specify the memory areas */
MEMORY
{
  VECTORS      (RX)  : ORIGIN = 0x1FFF8000, LENGTH = 0x00000240  /* Used for the vector table */
  TCM_L        (RX)  : ORIGIN = 0x1FFF8240, LENGTH = 0x00007DC0  /* Used for kernel functions */
  TCM_H        (RW)  : ORIGIN = 0x20000000, LENGTH = 0x00008000  /* Used for kernel data */
  OCRAM        (RW)  : ORIGIN = 0x20201000, LENGTH = 0x0003F000  /* Used for r/w application data; NOTE, address range 0x20200000-0x20200FFF is used for DDR frequency scaling by Linux on the UIC */
  DDR_CODE     (RX)  : ORIGIN = 0x80000000, LENGTH = 0x00080000  /* Used for application code and read-only data */
  DDR_DATA	   (RW)  : ORIGIN = 0x80080000, LENGTH = 0x00080000	 /* Used for large r/w application data (e.g. pre-allocated buffers, arrays, etc.) */
  DDR_AUDIO    (R )  : ORIGIN = 0x9ff00000, LENGTH = 0x00100000  /* Used for audio file read-only data */
}

 

标签 (1)
标记 (2)
0 项奖励
回复
3 回复数

2,336 次查看
joanxie
NXP TechSupport
NXP TechSupport

what bsp version do you use? what's your load steps? share the detailed steps with me

0 项奖励
回复

2,325 次查看
raveen
Contributor II

Hello joanxie,

BSP Version: 5.10.72-2.2.2

Load Steps:

# echo rpmsg_rtos_ddr.axf > /sys/class/remoteproc/remoteproc0/firmware

# echo start > /sys/class/remoteproc/remoteproc0/state

[ 231.254433] remoteproc remoteproc0: powering up imx-rproc
[ 231.323519] remoteproc remoteproc0: Booting fw image rpmsg_rtos_ddr.axf, size 1311480
[ 231.323573] remoteproc remoteproc0: No resource table in elf
[ 231.323671] imx-rproc imx7d-cm4: Translation failed: da = 0x1fff0000 len = 0x8240
[ 231.323683] remoteproc remoteproc0: bad phdr da 0x1fff0000 mem 0x8240
[ 231.323693] remoteproc remoteproc0: Failed to load program segments: -22
[ 231.323990] remoteproc remoteproc0: Boot failed: -22
0 项奖励
回复

2,309 次查看
joanxie
NXP TechSupport
NXP TechSupport

unfortunately imx7 couldn't support remoteproc currently

"https://community.nxp.com/t5/i-MX-Processors/imx6sx-remoteproc/m-p/781280"

0 项奖励
回复