In order to use the native USB for programming on pins PA11 and PA12, the following settings must be done in STM32CubeProgrammer → Option bytes → User Configuration.
Option byte name | Value | Description | Notes |
---|---|---|---|
NBOOT_SEL | 0 (Unchecked) | BOOT0 pin (legacy mode) | |
nBOOT1 | 1 (Checked) | Boot from Flash if BOOT0 = 1, otherwise System Memory | This is the factory setting |
NRST_MODE | 1 or 3 | 1: Reset input only 3. Bidirectional reset: The NRST pin is configured in reset input/output (legacy) mode | 3 is the factory setting |
Note: Native USB does not enumerate if HCLK is lower than the default 16 MHz, e.g. by adjusting the AHB prescaler. It will still work in bootloader mode for DFU, it only affects runtime usage of USB e.g. HID, CDC serial.
State | Peripherals | Memory | Voltage Supplies (VDDx) | STM32RTC::LSI_CLOCK | STM32RTC::LSE_CLOCK | STM32RTC::HSE_CLOCK |
---|---|---|---|---|---|---|
LowPower.idle() | On | On | On | Supported | Supported | Supported |
LowPower.sleep() | On | On | On | Supported | Supported | Supported |
LowPower.deepSleep() | On | On | On | Supported | Supported | Supported |
LowPower.shutdown() | Off | Off | Off | Supported |
: External hardware required
rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin();
__HAL_RCC_LSEDRIVE_CONFIG(__LSEDRV__)
; Select the lowest value that can provide robust LSE start-up5)__LSEDRV__
with:RCC_LSEDRIVE_LOW
RCC_LSEDRIVE_MEDIUMLOW
(default if __HAL_RCC_LSEDRIVE_CONFIG
is not called)RCC_LSEDRIVE_MEDIUMHIGH
RCC_LSEDRIVE_HIGH