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