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
Observer pr871
Observer
293 Views
Registered: ‎05-31-2018

Configuring Stack and Heap Sizes in Petalinux?

I have a large C application that I'm running on Linux on a ZCU104 board. When compiled with Xilinx SDK, I get an .elf file which runs without issue on the board. However, when the exact same code is compiled using SDSoC, I get an .elf file which throws a segmentation fault on a memcpy() function. It looks like an issue with heap allocation. In SDSoc, I've tried both a prebuilt ZCU104 platform as well as a custom platform using boot and image files created by Petalinux and the issue persists. When I was following the documentation to create the custom platform, I didn't notice anything about customizing stack and heap sizes. Is this something that can be done using the Petalinux tools?

I'm using the 2018.3 version of all tools.

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
217 Views
Registered: ‎08-20-2018

Re: Configuring Stack and Heap Sizes in Petalinux?

Hi @pr871 

Are you allocating the memory using sds_alloc()

If yes, then memcpy can not be used for memory allocated using sds_alloc.

Please let me know your goal then I can suggest how it is implemented in SDSoC

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Observer pr871
Observer
206 Views
Registered: ‎05-31-2018

Re: Configuring Stack and Heap Sizes in Petalinux?

@nutang 

I'm not using any SDSoC specific pragmas or function calls. I have a pure C application which runs fine when compiled with SDK but thows a segmentation fault when the exact same code is compiled with SDSoC. For SDSoC, I've tried both an application project targeting the prebuilt ZCU104 platform as well as a custom platform with manually generated BOOT.BIN and image.ub files (similar to the ones used to run the SDK version of the .elf) and the result is the same.

0 Kudos
Xilinx Employee
Xilinx Employee
186 Views
Registered: ‎08-20-2018

Re: Configuring Stack and Heap Sizes in Petalinux?

Hi @pr871 

Is it possible to share your project?

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos