1 Reply Latest reply on Aug 4, 2020 2:32 AM by EktaN_26

    PSoC5LP : Relationship between resume processing of USB component and UART interrupt priority

    MaMi_1205306

      Hi,

       

      We are considering PSOC5LP.

       

      < Use subsystem and component >

      - USB FS

      - Timer interrupt : priority default <7>

      - USB interrupt : priority default <7>

      - UART Tx and Rx interrupt : priority default <7>

      - Sleep mode

       

      <The process that causes the problem>

       

      PSoC5LP goes to sleep,

      Wake up with a timer interrupt.

       

      We have a question about the USB resume processing performed within the timer interrupt.

      We understand that in the USB resume processing, it is necessary to recognize the PICU interrupt of the USB Dp pin input.

      However, if the default interrupt priority is kept, resume processing will not operate properly.

       

      The following is the USB suspend and resume processing program executed in CY_ISR.

       

      ------------------------------

              CY_SET_REG8(CYREG_PICU15_INTTYPE6, USBFS_Dp_INTR_FALLING);

           

              USBFS_Suspend();

           

              // Sleep until interrupt of USB Dp

              do

              {

                  CyDelayUs(20);

                  CyPmSaveClocks();

                  CyPmSleep2(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_PICU);

                  CyPmRestoreClocks();

                  CyDelayUs(20);

              }

              while (!(CY_GET_REG8(CYREG_PICU15_INTSTAT) & 0x40));

       

       

              CY_SET_REG8(CYREG_PICU15_INTTYPE6, USBFS_Dp_INTR_NONE);

       

       

              USBFS_Resume();

      ------------------------------

       

      LED turn-off processing before this program,

      LED lighting processing is added after the program.

      Then, We have confirmed that it does not light up after "USBFS_Resume".

      It seems that I can't get out of the loop and reach the last USBFS_Resume.

       

      So the following question.

       

      1.

      In the above program,

      CYREG_PICU15_INTSTAT is used to determine the end of the loop.

      By raising the priority of UART_RXInternalInterrupt and UART_TXInternalInterrupt, the same program can exit the loop.

      At this time, the UART is not communicating, so the UART interrupt is not used.

       

      Do you know the reason or relationship to get it working?

       

      2.

      Regarding the interrupt priority, all other interrupts are set to Default <7>.

       

      If the priority of only UART_RXInternalInterrupt and UART_TXInternalInterrupt of Interrupts on the cydwr screen is raised 7 to 6 or more,

      Can you think of any possible problems?

       

      Regards,