cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

Contributor II

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?

0 Likes
Reply
1 Solution
New Contributor II

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.

View solution in original post

3 Replies
Esteemed Contributor II

As far as I remember there is an attribute setting  in GCC named NOINIT.

A short search led to this.

Bob

New Contributor II

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.

View solution in original post

Contributor II

Thanks, this looks really useful.

0 Likes
Reply