According to my understanding the reset is occurring due to Watchdog Timer (WDT).
1) In the code you have used CyGlobalIntDisable; This will disable interrupts from I2C and WDT.
2) The device is then sent to Sleep using the API: CyPmSleep ( PM_SLEEP_TIME_NONE , PM_ALT_ACT_SRC_CTW | PM_SLEEP_SRC_I2C ). However, since there is no interrupt from I2C due to interrupts being disabled the device will remain in Sleep.
3) The WDT counter increaments by one whenever a WDT interrupt occurs. Since the interrupts are disabled the WDT interrupt will not occur. But the WDT Counter will increament by one each time the central timewheel crosses the programmed tap point. When the counter reaches three, WDT asserts a hardware reset to the device.
You can try enabling the interrupts so that the device wakesup from Sleep and WDT is cleared.
I have created two test projects to test this. In both the projects I have disabled the global interrupts. In the project with sleep api the device is reset after some time (noticed by the blinking of the led) since the Cywdtclear(); is not executed as the device does not wake from Sleep. However the project in which I have not sent the device to sleep, reset does not occur as the wdt is periodically cleared by the Cywdtclear(); api.
Please let me know if this helps. In case this does not resolve you issue please attach you project so that we can recreate the issue at our side.
Good morning, with yours advices we have resolved. Thanks.