This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5505 : After shut down USB peripheral - UART stop functioning

Other Parts Discussed in Thread: TMS320C5515

I am trying to shut down USB peripheral on C5505 based custom board according to the instructions in C5505 User Guide (sprugh5a.pdf) on page 45 as follows:

1.5.3.4.1 Clock Configuration Process
The clock configuration process for the USB clock domain consists of disabling the USB peripheral clock
followed by disabling the USB on-chip oscillator. This procedure will completely shut off USB module,
which does not comply with USB suspend/resume protocol.
To set the clock configuration of the USB clock domain to idle follow these steps:
1. Set the SUSPENDM bit in FADDR register. For more information about the SUSPENDM bit, see the
TMS320C5515/14/05/04 DSP Universal Serial Bus 2.0 (USB) Controller User's Guide (SPRUGH9).
2. Set the USB clock stop request bit (USBCLKSTREQ) in the CLKSTOP register to request permission
to shut off the USB peripheral clock.
3. Wait until the USB acknowledges the clock stop request by polling the USB clock stop acknowledge bit
(USBCLKSTPACK) in the CLKSTOP register.
4. Disable the USB peripheral clock by setting USBCG = 1 in the peripheral clock gating control register 2
(PCGCR2).
5. Disable the USB oscillator by setting USBOSCDIS = 1 in the USB system control register (USBSCR).

Here is my code:

    // Idle the USB clock
    // Set the SUSPENDM bit in FADDR register.
    USB_FADDR_POWER |= 0x0200 ;

    // Set bit 2 - USB stop request
    REG_CLKSTOP |= 0x4;
    // Wait until USB stopped, poll bit 3
    while (0 == (REG_CLKSTOP & 0x8)){}

    // Delay
    for(int delay = 0; delay < 100; delay++);

    // Set Peripheral Clock Gating Configuration Register 2 (PCGCR2)
    // *************************************************************
    // Bit 2 - USB clock gate control bit. This bit is used to enable and disable the USB peripheral clock.
    SYS_PCGCR2 = 0x007F;

    USBSCR |= 0x8004 ;

The side effect of this procedure is that UART stops functioning.Can anyone suggest any hints how to troubleshoot this issue.

My configuration: CCS 5.2 compiler 4.4.1, CSL version 2.01

Thanks

  • Any ideas, hints, comments?

  • Robert,

    Are you using DMA with the UART?  It looks like you are also gating the clock to the DMA controllers when you set the PCGCR2 register to 0x007F.  You might try to only set bit 2 in the PCGCR2 register.

    Regards,

    Will

  • No, I am not using DMA at all. I initialized UART as follows:

        CSL_Status      status;
        
        status = UART_init(&uartObj, CSL_UART_INST_0, UART_POLLED ) ;
        if (CSL_SOK != status )
        {
           return false;
        }

    and configured as follows:

        CSL_Status      status;
       CSL_UartSetup     uartSetup;

       uartSetup.afeEnable = CSL_UART_NO_AFE;
       uartSetup.baud = stSrtup.uiBaudRate;
       uartSetup.clkInput = THM_CURRENT_CLOCK;
        
       //i want to work with FIFO mode, fifo for 8 chars (without DMA)
        //to disable FIFO mode , and work with 1 char, do - CSL_UART_FIFO_ENABLE;
       uartSetup.fifoControl = CSL_UART_FIFO_DMA1_DISABLE_TRIG08,
       uartSetup.loopBackEnable = CSL_UART_NO_LOOPBACK;
       uartSetup.parity =  CSL_UART_DISABLE_PARITY;
       uartSetup.rtsEnable = CSL_UART_NO_RTS;

        switch(stSrtup.enStopBit)
        {
            case eTHM_UART_STOP_BIT_1 :
            {
                uartSetup.stopBits = CSL_UART_LCR_STB_1STOPBIT;
                break;
          }
            
          default :
          {
                return false;
          }
        }

        switch(stSrtup.enDataBit)
        {
            case eTHM_UART_DATA_BIT_8 :
            {
                uartSetup.wordLength = CSL_UART_WORD8;
                break ;
          }
            
          default :
          {
                return false;
          }
        }
     
       status =  UART_setup(&uartObj,&uartSetup);
            
        if (CSL_SOK != status )
        {
            return false;
        }

  • Hi,

    I don't see any problem in your listed code. However I would try comment out each line to find what exact line of code causing this issue. 

    Regards,

    Hyun