1) CyU3PDeviceReset (0) is cold reset. Doing this will jump back to the bootloader and firmware has to download again. (If the PMODE pins is set I2C or SPI boot, it will again download firmware from memory devices. If it is USB Boot, it will wait for the firmware to be downloaded via USB. If you want to do warm reset (firmware will start from the beginning without downloading again), you need to call CYU3PDeviceReset (1). If you are going to pass '1', make sure that all the peripherals (like USB, PIB, UART whichever is used) are deinitialized using the corresponding DeInit function. For example, you need to call:
inside the error handler function.
2) Those APIs are to be used in the boot loader. If you are running your normal application firmware, there are alternate APIs:
CyU3PSysWatchDogConfigure and CyU3PSysWatchDogClear.
Before beginning a complex tast you need to call CyU3PSysWatchDogConfigure (enable, milliseconds); Enable has to be set to 1. milliseconds is the period in milliseconds after which the device will reset. (if not responsive)
If the task is finished successfully, you need to call CyU3PSysWatchDogClear () to prevent the device from reset.
- Madhu Sudhan