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: 
Explorer
Explorer
2,027 Views
Registered: ‎07-28-2008

zynqmp how to SDK step through bsp code (2017.1)

Jump to solution

I am learning xapp1306, created a bsp with FSBL generation, and made a new app based on the bsp.

 

After setting "-O0 -g3" in bsp build, the FSBL app failed with not enough memory (OCM) error.

My A53 standalone app still steps into assembly.

 

A53 application with regular bsp generation, stepping through bsp is fine.

 

So I need to understand how to step into bsp made with FSBL, or maybe how to reduce the bsp size, or move bsp somewhere else with more memory.

 

Please comment,

 

Thanks,

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
3,166 Views
Registered: ‎02-01-2008

Re: zynqmp how to SDK step through bsp code (2017.1)

Jump to solution

If you are having problems single stepping through FSBL and the FSBL bsp, then it is because LTO (link time optimization) is enabled. This option has been enabled in order to reduce the memory footprint of FSBL so that it can fit in a portion of OCM.

 

It is possible to disable LTO and reduce the fsbl BSP to -O2 and possibly fit in memory (dependent on what options you are using in fsbl).

 

Disable LTO and change optimization on BSP:

- right click on fsbl_bsp, select board_support_package_settings, select overview->standalone, change zynqmp_fsbl_bsp to false

- select overview->drivers->psu_cortex53->extra_compiler_flags, change -Os to -O2, and remove -flto and remove --ffat-lto-objects

- ok

- The above provides a .elf that fits in memory

 

To go further, disable LTO and change optimization on app:

- right click on fsbl, select C/C++ settings

- remove -Os, -flto and -ffat-lto-objects from ARM A53 gcc compiler->Miscellaneous->other_flags

- note that ARM A53 gcc compiler->optimization is set to -O0.

- note that fsbl will not fit in ocm at this point.

 

Reduce FSBL code size:

- edit fsbl->src->xfsb_config.h and change the following defines to exclude the code:

FSBL_NAND_EXCLUDE_VAL (1U)

FSBL_QSPI_EXCLUDE_VAL (1U)

FSBL_SECURE_EXCLUDE_VAL (1U)

 

Now, fsbl should fit in OCM. You can play around with these exclude values depending on what features of FSBL you require.

 

 

 

 

 

 

5 Replies
Moderator
Moderator
1,965 Views
Registered: ‎10-06-2016

Re: zynqmp how to SDK step through bsp code (2017.1)

Jump to solution

Hi @legendbb

 

After reading your post I'm not still sure where the problem is, I mean compiling the FSBL in OCM or step into the BSP code, can you clarify this? I guss that it might by a mix of both (compiling code in O0 to be able to debug the FSBL) but would be great to clarify it :)

 

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Explorer
Explorer
1,959 Views
Registered: ‎07-28-2008

Re: zynqmp how to SDK step through bsp code (2017.1)

Jump to solution
Thanks for attention, and sorry for not being clear in the first post.

1. I don't know, for xapp1306 setup, if the bsp has to be the one generated with FSBL creation.
2. I understood, the bsp generated with FSBL creation sits in OCM, which has not enough space if "-O0 -g3 " is turned on.
3. I have no problem stepping through regular bsp (created with app generation).
0 Kudos
Moderator
Moderator
1,951 Views
Registered: ‎10-06-2016

Re: zynqmp how to SDK step through bsp code (2017.1)

Jump to solution

Hi @legendbb

 

I did not really tested the XAPP1306 but as long as the FSBL code is the same for any hardware project, it's bit strange to not be able to compile it in debug mode.

 

Are you using the default standalone BSP for the FSBL application? I mean if you enable extra libraries a would expect to not fit in OCM but otherwise it should be fit.

 

Can you share your HDF file to test it quickly on my side?


Regards

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Xilinx Employee
Xilinx Employee
3,167 Views
Registered: ‎02-01-2008

Re: zynqmp how to SDK step through bsp code (2017.1)

Jump to solution

If you are having problems single stepping through FSBL and the FSBL bsp, then it is because LTO (link time optimization) is enabled. This option has been enabled in order to reduce the memory footprint of FSBL so that it can fit in a portion of OCM.

 

It is possible to disable LTO and reduce the fsbl BSP to -O2 and possibly fit in memory (dependent on what options you are using in fsbl).

 

Disable LTO and change optimization on BSP:

- right click on fsbl_bsp, select board_support_package_settings, select overview->standalone, change zynqmp_fsbl_bsp to false

- select overview->drivers->psu_cortex53->extra_compiler_flags, change -Os to -O2, and remove -flto and remove --ffat-lto-objects

- ok

- The above provides a .elf that fits in memory

 

To go further, disable LTO and change optimization on app:

- right click on fsbl, select C/C++ settings

- remove -Os, -flto and -ffat-lto-objects from ARM A53 gcc compiler->Miscellaneous->other_flags

- note that ARM A53 gcc compiler->optimization is set to -O0.

- note that fsbl will not fit in ocm at this point.

 

Reduce FSBL code size:

- edit fsbl->src->xfsb_config.h and change the following defines to exclude the code:

FSBL_NAND_EXCLUDE_VAL (1U)

FSBL_QSPI_EXCLUDE_VAL (1U)

FSBL_SECURE_EXCLUDE_VAL (1U)

 

Now, fsbl should fit in OCM. You can play around with these exclude values depending on what features of FSBL you require.

 

 

 

 

 

 

Explorer
Explorer
1,943 Views
Registered: ‎07-28-2008

Re: zynqmp how to SDK step through bsp code (2017.1)

Jump to solution
Thanks a lot for offering testing, I enabled lwip. And I can understand if OCM won't fit.

I'm curious for xapp1306, if bsp won't fit in OCM. What happens if I just use regular bsp in DDR?
0 Kudos