- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using Creator 4.4 in a PSoC4 project.
For best size optimization, under "Build Settings" I enabled "Link Time Optimization".
For maximum gain I also added "-fwhole-program" as Custom Flag for both Compiler and Linker.
With the above options there are compilation errors caused by removal of some global symbol.
After debugging I found that the following changes are required into file ".\Generated_Source\PSoC4\Cm0plusStart.c".
//!void Reset(void)
void __attribute__((externally_visible))Reset(void)
//!cyisraddress CyRamVectors[CY_NUM_VECTORS];
cyisraddress __attribute__((externally_visible)) CyRamVectors[CY_NUM_VECTORS];
//!const cyisraddress RomVectors[CY_NUM_ROM_VECTORS] =
const cyisraddress __attribute__((externally_visible)) RomVectors[CY_NUM_ROM_VECTORS] =
The GCC attribute "externally_visible" correctly prevents the optimization on these symbols.
With the above fix I was able to test a working application and save quite Flash space thanks to LTO.
I hope this could be of interest to someone.
I suggest to file an enhancement request so that this fix could be included in a future revision of cy_boot component.
Regards,
Giuliano
- Labels:
-
PSoC Creator & Designer Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Giuliano,
Thank you for sharing the enhancement details.
We will file an internal ticket regarding this.
Regards