1 Reply Latest reply on Feb 3, 2018 9:22 PM by Madhu Lakshmipathy

    [FX3 CYUSB3014] Question of firmware (reset/watchdog)

    user_318654407

      Hi all,


      I have tested ESD (Electro-static Discharge) test.
      To prevent CYUSB304 stopping, I need reset code or watchdog timer code.
      So, I want to know how to add code below two cases.

       

      1) case 1: RESET
      In CyFxAppErrorHandler() function,
      may I add CYU3PDeviceReset(0) function? or CYU3PDeviceReset(1)?

      2) case 2: WATCHDOG TIMER
      I checked CyFx3BootWatchdogConfigure() and CyFx3BootWatchdogClear() function.
      I don't know where these functions locate and how to use these functions.

       

      Please response my questions.

       

      Regard, thank you.
      Kim 

        • 1. Re: [FX3 CYUSB3014] Question of firmware (reset/watchdog)
          Madhu Lakshmipathy

          Hi,

           

          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:

          CyU3PPibDeInit ();

          CyU3PUartDeInit ();

          CyU3PUsbDeInit ();

          CyU3PDeviceReset (1);

          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.

           

          Regards,

          - Madhu Sudhan