cancel
Showing results for 
Search instead for 
Did you mean: 

ModusToolbox General

gisc_1091076
New Contributor II

Hi,

I have been using the evaboard such 62S2 43012. I am starting from the example project 'BLE_CapSense_Buttons_Slider'. The my application works so, it remains in idle for 3 seconds and after enter in hibernate mode. Out of the state of hibernate throught the wdt. Sometimes it happens that when the application restart the reason is not always same. Sometimes the reason of the reset is wdr, other times is the wake up depends from hibernate mode. I do reading the reason of the reset when the application restarts with function cyhal_system_get_reset_reason (). Why in the my application sometimes the reason reset is the wdt (CYHAL_SYSTEM_RESET_WDT) and another times is the hibernate mode (CYHAL_SYSTEM_RESET_HIB_WAKEUP) ?

I setted the hibernate mode in the follows way:

// Create callback to active hibernate mode

cy_stc_syspm_callback_params_t myParams ;

cy_stc_syspm_callback_t myAppHibernate =

{

&Application_Callback , /* Callback function */

CY_SYSPM_HIBERNATE , /* Select Power Mode */

0U , /* Skip mode, no skip */

&myParams , /* Operation, contexts */

NULL , /* Previous list callback */

NULL /* Next list callback */

} ;

/* Register Callback functions for each power mode */

Cy_SysPm_RegisterCallback ( &myAppHibernate ) ;

While the wdt i declared in this way :

cy_rslt_t result ;

/** UART HAL object used by this library */

extern cyhal_uart_t cy_retarget_io_uart_obj ;

/* Wait until UART transfer complete  */

while ( 1UL == cyhal_uart_is_tx_active ( &cy_retarget_io_uart_obj ) ) ;

cy_rslt_t res = cyhal_syspm_hibernate(CYHAL_SYSPM_HIBERNATE_WDT) ;

/* Initialize the WDT */

result = cyhal_wdt_init ( &wdt_obj , 3000 ) ;

/* WDT initialization failed. Stop program execution */

if  ( result != CY_RSLT_SUCCESS )

{

     printf("Failed to initialize WDT!\r\n" ) ;

     CY_ASSERT ( 0 ) ;

}

Can you help me ?

thanks

0 Likes
1 Solution
Roy_Liu
Moderator
Moderator

You may have a look at the application notes on PSoC6 device interrupt and power models: 

PSoC 6 MCU Interrupts (cypress.com)

AN219528 - PSoC 6 MCU Low-Power Modes and Power Reduction Techniques (cypress.com)

Roy Liu

View solution in original post

0 Likes
7 Replies
ShipingW_81
Moderator
Moderator

It looks the both reset reasons are reasonable.

The WDT reset reason might be caused by several unhandled interrupt during active mode. Another reason - wake up from Hibernate mode, just shows the reset is asserted by wake up in hibernate mode.

For all PSoC 6 devices, wake up from hibernate mode must go through reset process.

0 Likes
gisc_1091076
New Contributor II

Hi,

You’re right, but my fw has to wake up from hibernate mode via wdt every 3 seconds. What I don’t understand is because sometimes the reason for the reset is the wdt which is correct, while sometimes the reason for the awakening is the hibernate mode. My device is correct that it wakes up via wdt. But why is not the cause of the awakening always wdt ? Why does it sometimes return me that the cause of awakening is hibernate mode ?

Thanks you

0 Likes
ShipingW_81
Moderator
Moderator

Sorry for late reply.

The WDT interrupt is the wake up source of hibernate mode. However, wake up from hibernate would cause a system reset.

That means the direct cause of system reset is hibernate wake up, regardless of the cause of wake up.

The reset reason always refers to the direct reason.

0 Likes
gisc_1091076
New Contributor II

Ok, i have understand in general as its works the logical of system, but i don't understand why the reason of the reset is not always same (for example always wdt) ? I want deepen this problem becuase i would like to avoid that there is a error in my application that i have been developing.

Thanks you.

0 Likes
Roy_Liu
Moderator
Moderator

You may have a look at the application notes on PSoC6 device interrupt and power models: 

PSoC 6 MCU Interrupts (cypress.com)

AN219528 - PSoC 6 MCU Low-Power Modes and Power Reduction Techniques (cypress.com)

Roy Liu

View solution in original post

0 Likes
ShipingW_81
Moderator
Moderator

The reason why 'the reset reason not always same' has been clarified in last post. Let me know if it missed your meaning?

0 Likes
gisc_1091076
New Contributor II

i made further test. The device, initially return me only a reason (wdr) of awakening. After some time, letting the device working, the value that return me the function cyhal_system_get_reset_reason è 17, this value indicate that reason the wake up are two, wdr and hibernate mode. I don't understand this this behavior does not regular. There are a motive that explains this behavior fluctuating ? Why the device does not always behave in the same way ? is this aspect that i don't understand, the device must behave always in the same way, it not can modificate it randomly. That is, it should always give back the same reasons of the awakening, if there is nothing that affects the behavior of the device.

Thanks you

0 Likes
Top labels