- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
My team and I are trying to decrease the heap and stack sizes of the bootloadable but it doesn't seem to work. We have a PSOC 4 MCU and are using PSOC Creator 4.2.
We encountered this forum discussion: Bug - Stack/heap sizes in cm0gcc.ld file for BLE OTA do not change with .cydwr entries? - here cypress confirms that there is a bug and that it is not possible to change the heap and stack sizes from within PSOC Creator in the case of bootloader projects and that they should be changed manually within the linker files.
That's OK, except that my team and I are not sure exactly what we need to change in the linker files and what files are they exactly.
Could you please provide some more detailed explanation as to how to do this manually?
Thanks,
David
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For customization Fixed Stack OTA bootloader project use custom linker scripts. The location of custom linker script is added as part of Project > Build Settings > Linker > Custom Linker Script. Please update size values in following lines of code in custom linker script to modify heap and stack sizes.
PROVIDE(__cy_heap_end = __cy_stack - 0x0800);
.heap (NOLOAD) :
{
. = _end;
. += 0x80;
__cy_heap_limit = .;
} >ram
.stack (__cy_stack - 0x0800) (NOLOAD) :
{
__cy_stack_limit = .;
. += 0x0800;
} >ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For customization Fixed Stack OTA bootloader project use custom linker scripts. The location of custom linker script is added as part of Project > Build Settings > Linker > Custom Linker Script. Please update size values in following lines of code in custom linker script to modify heap and stack sizes.
PROVIDE(__cy_heap_end = __cy_stack - 0x0800);
.heap (NOLOAD) :
{
. = _end;
. += 0x80;
__cy_heap_limit = .;
} >ram
.stack (__cy_stack - 0x0800) (NOLOAD) :
{
__cy_stack_limit = .;
. += 0x0800;
} >ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Can you provide more detail on the code snippet?
e.g. What are the new sizes of ram componenets in your exmaple?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fixed stack code example by default uses hardcoded heap and stack sizes. The required amount of heap and stack size depend on the end application. Please refer to Controlling SRAM Usage in PSoC® Applications - KBA93584 to get a better idea on SRAM usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This document you specified does not work on BLE_OTA project.
Any other document available?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In GeonaM's post above, if you change all the places that have 0x800 then that is the size of the stack. If you change the value of 0x80 then you would be changing the size of the heap.
The file that GeonaM is referring to is called cm0gcc.ld