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: 
Visitor claudiofi
Visitor
7,610 Views
Registered: ‎02-25-2016

remoteproc: truncated fw

Hello,

 

we are using the following configuration:

- XSDK 2015.4
- PetaLinux 2015.4 with OpenAmp framework

In order to use the Zynq core0 like master (o.s. Petalinux) and core 1 like slave with FreeRTOS 8.23

In our tests we have manipulate the "OpenAMP RPC Demo" template and  its elf file is incremented in lenght. When  we launch the command "proxy_app -m zynq_remoteproc" the system answers with these messages:

 

 Error.JPG

 

Do you have some advice?

 

Thank you in advance,

Claudio

 

0 Kudos
12 Replies
Visitor claudiofi
Visitor
7,560 Views
Registered: ‎02-25-2016

Re: remoteproc: truncated fw

From the message it seems we are out of memory, but we are sure the memory is enough, we have one GB of ram available for the second core.
0 Kudos
Newbie mdct1024
Newbie
3,275 Views
Registered: ‎02-05-2018

Re: remoteproc: truncated fw

Hi

 

I am having the same issues as described.

 

Could someone advise some pointers on how to deal with the issues?

 

 

0 Kudos
Moderator
Moderator
3,267 Views
Registered: ‎05-10-2017

Re: remoteproc: truncated fw

@mdct1024

Which version of the tools are you using? Are you trying to run the echo-test as well? Is this for zynq-7000 or zynq ultrascale+?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Newbie mdct1024
Newbie
3,237 Views
Registered: ‎02-05-2018

Re: remoteproc: truncated fw

Hi

 

I am using:

1) Zynq-7000

2) Petalinux 2015.4

3) SDK 2015.4 (Windows)

4) Yes I am using echo-test with FreeRTOS (ver 8.2.3) for Core 1 and Petalinux 2015.4 for Core 0

 

After executing modprobe zynq_remoteproc firmware=echo_test.elf on the Linux side, the system prompted about truncated fw which is exactly what is posted in the thread by other users  of this forum.

 

I am building on top of the echo-test example project provided by the SDK but did not call any functions from the c codes that I have added in the echo-test project.

 

If I don't include my codes, remoteproc is able launch the echo-test in core 1. Therefore, it seems that remoteproc is not able to cope with loading elf file of larger size. 

 

I am wondering if you could advise some pointers to deal with this issue.

 

regards

Chow 

 

0 Kudos
Moderator
Moderator
3,172 Views
Registered: ‎05-10-2017

Re: remoteproc: truncated fw

Have you tried increasing the reserved memory in the device-tree? How much is it getting truncated by?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
2,665 Views
Registered: ‎01-18-2018

Re: remoteproc: truncated fw

Hi @mdct1024

 

Just replying here from the OpenAMP google groups.

 

I am facing the same issue of yours, but I do not manage to get rid of that "truncated fw" error. Indeed the issue is raised by

 

remoteproc_elf_loader.c:184

 

if (offset + filesz > fw->size) 
{ dev_err(dev, "truncated fw: [hdr 0x%x] need 0x%x avail 0x%zx\n", i, offset + filesz, fw->size); ret = -EINVAL; break; }

 

 

Where the offset (0x30000) does not match the fw->size (0x285f8c in my case). In the following, the debug messages added to check which elf segment causes the error.

 

 

remoteproc remoteproc0: Booting fw image lwip_baremetal.elf, size 2645900                 
remoteproc remoteproc0: registered virtio0 (type 7)                                       
remoteproc remoteproc0: i 1                                                               
remoteproc remoteproc0: fw->size 0x285f8c                                                 
remoteproc remoteproc0: filesz 0xebfac                                                    
remoteproc remoteproc0: offset 0x10000                                                    
remoteproc remoteproc0: i 2                                                               
remoteproc remoteproc0: fw->size 0x285f8c                                                 
remoteproc remoteproc0: filesz 0x108010                                                   
remoteproc remoteproc0: offset 0x100000                                                   
remoteproc remoteproc0: i 3                                                               
remoteproc remoteproc0: fw->size 0x285f8c                                                 
remoteproc remoteproc0: filesz 0x0                                                        
remoteproc remoteproc0: offset 0x300000                                                   
remoteproc remoteproc0: truncated fw: [hdr 0x3] need 0x300000 avail 0x285f8c              
remoteproc remoteproc0: Failed to load program segments: -22                              
remoteproc remoteproc0: Boot failed: -22 

By dumping elf content with readelf -a, seems that the segment 3 is causing the issue (i=3) because the Linux module expects to have bigger fw->size or a not null FileSiz for that section.

 

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x208000 0x3e208000 0x3e208000 0x00008 0x00008 R   0x4
  LOAD           0x010000 0x3e000000 0x3e000000 0x28aac 0x28aac RWE 0x10000
  LOAD           0x100000 0x3e100000 0x3e100000 0x108010 0x108010 RW  0x10000
  LOAD           0x300000 0x3e300000 0x3e300000 0x00000 0x21d930 RW  0x10000

 Section to Segment mapping:
  Segment Sections...
   00     .ARM.exidx 
   01     .text .init .fini .rodata .data 
   02     .resource_table .eh_frame .mmu_tbl .ARM.exidx .init_array .fini_array 
   03     .bss .heap .stack 

 

 

Could you share your solution? Need to patch the automatically generated linker script?

 

Thanks,

Luca

0 Kudos
Newbie eep1nc
Newbie
2,648 Views
Registered: ‎04-18-2018

Re: remoteproc: truncated fw

Hi Luca

My soln requires modifying the linker script which was generated by SDK.
Add a section something like the following:
:
.fill:{
FILL(0xDeadBeef);
.= ORIGIN(yourDdrbase) +LENGTH(yourDdr Base) -1;
:
}> yourDdrBase
:

This should fill the gaps with oxDeadBeef all the way till end of your firmware.


Regards

Chow
0 Kudos
Contributor
Contributor
2,634 Views
Registered: ‎01-18-2018

Re: remoteproc: truncated fw

Hi Chow,

thanks for your reply.

 

It works as expected by the remoteproc_elf_loader. The filled section size might be resized though, to reduce the elfsize. Just a little add, the linker does expect the BYTE() command to fill at least one entry in the section.

 

.fill :
  {
    FILL(0xDEADBEEF);
    . = ORIGIN(ps7_ddr_0) + LENGTH(ps7_ddr_0) - 1;
    BYTE(0xAA)
  } > ps7_ddr_0

Thank you,

Luca

0 Kudos
Visitor leopoldo
Visitor
1,537 Views
Registered: ‎07-26-2018

Re: remoteproc: truncated fw

Hi Luca

 

I'm using

Vivado SDK 2017.4

Petalinux 2017.4

 

I'm writing a custom application modified , adding code , in FreeRTOS FW of matrix_multiply demo.

 

OpenAMP UG1186

 

matrix_multiply_demo defines

 

ps7_ddr0_S_AXI_BASEADDR in lscript.ld as :

 

Base addr 0x3e000000  Size 0x00400000

 

Adding code to demo, there is error of overflow ddr0

 

How do I modify system-user.dtsi , openamp-overlay.dtsi and lscript.ld ?

 

Actually :

 

system-user.dtsi

 

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

    amba {
        elf_ddr_0: ddr@ {
            compatible = "mmio-sram";
            reg = <0x3e000000 0x400000>;
        };
    };
    remoteproc0: remoteproc@0 {
        compatible = "xlnx,zynq_remoteproc";
        firmware = "FreeRTOS";
        vring0 = <15>;
        vring1 = <14>;
        srams = <&elf_ddr_0>;

    };
};

 

and openamp-overlay.dtsi

 

/ {
    reserved-memory {
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;
        rproc_0_reserved: rproc@3e000000 {
            no-map;
            reg =  <0x3e000000 0x01000000>;
        };
    };

    amba {
        elf_ddr_0: ddr@0 {
            compatible = "mmio-sram";
            reg = <0x3e000000 0x400000>;
        };
    };
    remoteproc0: remoteproc@0 {
        compatible = "xlnx,zynq_remoteproc";
        firmware = "FreeRTOS";
        vring0 = <15>;
        vring1 = <14>;
        srams = <&elf_ddr_0>;

    };
};

 

Thanks

 

 

 

0 Kudos
Moderator
Moderator
1,048 Views
Registered: ‎05-10-2017

Re: remoteproc: truncated fw

Can you please post what error are you seeing?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Visitor leopoldo
Visitor
1,034 Views
Registered: ‎07-26-2018

Re: remoteproc: truncated fw

I'm seeing this result :

 

 

 

 

 

 

 

 

I modified lscript.ld with Size 0x2C1000000 to bypass error in SDK :

 

The problem is :

 

truncated fw : need 0x300000 avail ........

 

Wait for solutions , thanks

3.png
2.png
1.png
0 Kudos
Moderator
Moderator
1,017 Views
Registered: ‎05-10-2017

Re: remoteproc: truncated fw

Can you increase the stack size and heap size and rebuild your application in sdk?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos