- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a "simple" way to modify the linker for the CYW43907 to preserve a small block of ram across a SW reset to preserve some debug information, like a register dump in the case of an exception?
In a smaller environment I would create a new section in the linker and modify the startup code to skip initialization of this section. I am not sure where to start in WICED...
Any suggestions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We modifed "ota2_app_without_rom.ld" and added the "fault_status_section" just after the always_on_ram section. The (NOLOAD) property does what you want wrt to not initializing any data.
.always_on_ram :
{
. = ALIGN(4);
KEEP(*(.rodata.tinybl*))
*(.deep_sleep_saved_vars.*)
} > AONRAM
.fault_status_section (NOLOAD):
{
. = ALIGN(4);
*(.fault_status)
} > AONRAM
Make sure to add an attribute to whatever you are saving off so it gets assigned to that section and then in the fault handler make sure the shutdown type is "PLATFORM_RESET_TYPE_RESET" instead of "PLATFORM_RESET_TYPE_POWERCYCLE" (our call looks like " platform_mcu_specific_reset( PLATFORM_RESET_TYPE_RESET );".
It has worked well for us to save off faults so we can report them to the cloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I remember there is an attribute setting in GCC named NOINIT.
A short search led to this.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We modifed "ota2_app_without_rom.ld" and added the "fault_status_section" just after the always_on_ram section. The (NOLOAD) property does what you want wrt to not initializing any data.
.always_on_ram :
{
. = ALIGN(4);
KEEP(*(.rodata.tinybl*))
*(.deep_sleep_saved_vars.*)
} > AONRAM
.fault_status_section (NOLOAD):
{
. = ALIGN(4);
*(.fault_status)
} > AONRAM
Make sure to add an attribute to whatever you are saving off so it gets assigned to that section and then in the fault handler make sure the shutdown type is "PLATFORM_RESET_TYPE_RESET" instead of "PLATFORM_RESET_TYPE_POWERCYCLE" (our call looks like " platform_mcu_specific_reset( PLATFORM_RESET_TYPE_RESET );".
It has worked well for us to save off faults so we can report them to the cloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, this looks really useful.