EasyManuals Logo
Home>ST>Microcontrollers>STM32G474

ST STM32G474 User Manual

ST STM32G474
2126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #2022 background imageLoading...
Page #2022 background image
Universal serial bus full-speed device interface (USB) RM0440
2022/2126 RM0440 Rev 4
The actual procedure used to suspend the USB peripheral is device dependent since
according to the device composition, different actions may be required to reduce the total
consumption.
A brief description of a typical suspend procedure is provided below, focused on the USB-
related aspects of the application software routine responding to the SUSP notification of
the USB peripheral:
1. Set the FSUSP bit in the USB_CNTR register to 1. This action activates the suspend
mode within the USB peripheral. As soon as the suspend mode is activated, the check
on SOF reception is disabled to avoid any further SUSP interrupts being issued while
the USB is suspended.
2. Remove or reduce any static power consumption in blocks different from the USB
peripheral.
3. Set LP_MODE bit in USB_CNTR register to 1 to remove static power consumption in
the analog USB transceivers but keeping them able to detect resume activity.
4. Optionally turn off external oscillator and device PLL to stop any activity inside the
device.
When an USB event occurs while the device is in SUSPEND mode, the RESUME
procedure must be invoked to restore nominal clocks and regain normal USB behavior.
Particular care must be taken to insure that this process does not take more than 10 ms
when the wakening event is an USB reset sequence (See “Universal Serial Bus
Specification” for more details). The start of a resume or reset sequence, while the USB
peripheral is suspended, clears the LP_MODE bit in USB_CNTR register asynchronously.
The resume procedure should be run just after the end of the suspend one, so its code is
immediately executed as soon as the system clock restarts. It is therefore never necessary
to handle a WKUP event as an interrupt. If multiple events could have caused the system
resume (via EXTI) it is recommended to restart the USB 48 MHz clock as soon as possible.
Once this clock is active it is possible to confirm if the event source was the USB resume
(i.e. WKUP bit). To prevent ESD discharges or any other kind of noise from waking-up the
system (the exit from suspend mode is an asynchronous event), a suitable analog filter on
data line status is activated during suspend; the filter width is about 70 ns.
The following is a list of actions a resume procedure should address:
1. Optionally turn on external oscillator and/or device PLL, and further wait for USB
48 MHz clock activation (this is required before making any USB register accesses).
2. Clear FSUSP bit of USB_CNTR register, and further wait for USB 48 MHz clock
activation (this is required before making any USB register access).
3. If the resume triggering event has to be identified, bits RXDP and RXDM in the
USB_FNR register can be used according to Table 411, which also lists the intended
software action in all the cases. If required, the end of resum
e or reset sequence can
be detected monitoring the status of the above mentioned bits by checking when they
reach the “10” configuration, which represent the Idle bus state; moreover at the end of
a reset sequence the RESET bit in USB_ISTR register is set to 1, issuing an interrupt if
enabled, which should be handled as usual.

Table of Contents

Questions and Answers:

ST STM32G474 Specifications

General IconGeneral
BrandST
ModelSTM32G474
CategoryMicrocontrollers
LanguageEnglish

Related product manuals