11-04-2017 09:23 AM - edited 11-04-2017 09:48 AM
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,
11-06-2017 08:52 AM
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.
11-06-2017 06:10 AM
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
11-06-2017 06:23 AM
11-06-2017 07:27 AM
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
11-06-2017 08:52 AM
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.
11-06-2017 08:56 AM