====== STM32U0 Notes ====== ===== Literature ===== * Datasheets * [[https://www.st.com/resource/en/datasheet/stm32u031f4.pdf|DS14581 STM32U031x4/6/8]] * [[https://www.st.com/resource/en/datasheet/stm32u073c8.pdf|DS14548 STM32U073x8/B/C]] * [[https://www.st.com/resource/en/datasheet/stm32u083kc.pdf|DS14463 STM32U083xC]] * Application Notes * [[https://www.st.com/resource/en/application_note/an5938-getting-started-with-stm32u0-mcus-hardware-development-stmicroelectronics.pdf|AN5938 Getting started with STM32U0 MCUs hardware development]] * [[https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf|AN2606 STM32 microcontroller system memory boot mode]] * Reference Manual * [[https://www.st.com/resource/en/reference_manual/rm0503-stm32u0-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf|RM0503 Reference manual]] ===== Development Boards ===== - [[https://www.st.com/en/evaluation-tools/nucleo-u083rc.html|Nucleo-U083RC]] (STM32U083RCT6) * Purchasing * [[https://sg.element14.com/stmicroelectronics/nucleo-u083rc/dev-board-32bit-arm-cortex-m0/dp/4377835|S$21.68 at element14]] * User Manuals * [[https://www.st.com/resource/en/user_manual/um1727-getting-started-with-stm32-nucleo-board-software-development-tools-stmicroelectronics.pdf|UM1727 Getting started with STM32 Nucleo board software development tools]] * [[https://www.st.com/resource/en/user_manual/um3256-stm32-nucleo64-boards-mb1932-stmicroelectronics.pdf|UM3256 STM32 Nucleo-64 boards (MB1932)]] - [[https://www.st.com/en/evaluation-tools/stm32u083c-dk.html|STM32U083C-DK]] (STM32U083MC) * Purchasing * [[https://sg.element14.com/stmicroelectronics/stm32u083c-dk/discovery-kit-32bit-arm-cortex/dp/4377838|S$37.06 at element14]] * User Manuals * [[https://www.st.com/resource/en/user_manual/um3292-discovery-kit-with-stm32u083mc-mcu-stmicroelectronics.pdf|UM3292 Discovery kit with STM32U083MC MCU]] * [[https://www.st.com/resource/en/user_manual/um3313-stm32cubeu0-stm32u083cdk-demonstration-firmware-stmicroelectronics.pdf|UM3313 STM32CubeU0 STM32U083C-DK demonstration firmware]] ===== Operating Conditions ===== * VDDx * 1.71 ≤ VDDx ≤ 3.60 V (absolute maximum: 4.00 V) * Nucleo-083RC LEDs become very dim when 3.3V net falls below 1.80 V * Brownout Reset((RM0503, §3.7.7: FLASH option register (FLASH_OPTR), Bits 10:8 BOR_LEV[2:0]: BOR reset level)) * Selectable: 1.7, 2.0, 2.2, 2.5 or 2.8 V ===== Native USB (STM32U073, STM32U083) ===== 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) | :!: Factory setting is 1. You must change it to 0 to keep USB DFU programming capability. :!: | | 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. ===== STM32duino LowPower & RTC ===== ^ 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 ==== Prerequisites for LowPower.shutdown() ==== * External 32.768 kHz crystal for LSE((DS14581/DS14548/DS14463, §6.3.7: External clock source characteristics, Low-speed external clock generated from a crystal resonator)) * rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin(); ===== Choosing an LSE Crystal ===== - **Hardware** - Choose a **32.768 kHz crystal oscillator**(([[https://www.st.com/resource/en/application_note/an2867-guidelines-for-oscillator-design-on-stm8afals-and-stm32-mcusmpus-stmicroelectronics.pdf|AN2867 Guidelines for oscillator design on STM8AF/AL/S and STM32 MCUs/MPUs]], §5.2: STM32-compatible low-speed resonators, Table 7: Recommended crystal / MEMS resonators for the LSE oscillator in STM32 products)) * JLCPCB basic part: [[https://jlcpcb.com/partdetail/SeikoEpson-Q13FC13500004/C32346|Seiko Epson FC-135 32.768 KHz 12.5 pF ±20 ppm]] - Choose the **load capacitance** * C1 = C2 = 2 * (CL - Cstray) * "Stray capacitance Cstray comes from the pins of the chip and parasitics from the board. It is often approximated as 5pF."(([[https://microchip.my.site.com/s/article/Calculating-crystal-load-capacitor|Calculating crystal load capacitor]])) - **Software** - Configure **LSE drive level**: ''%%__HAL_RCC_LSEDRIVE_CONFIG%%(//%%__LSEDRV__%%//)''; Select the lowest value that can provide robust LSE start-up((RM0503, §5.2.6: LSE clock))\\ Substitute ''//%%__LSEDRV__%%//'' with: - ''RCC_LSEDRIVE_LOW'' - ''RCC_LSEDRIVE_MEDIUMLOW'' (default if ''%%__HAL_RCC_LSEDRIVE_CONFIG%%'' is not called) - ''RCC_LSEDRIVE_MEDIUMHIGH'' - ''RCC_LSEDRIVE_HIGH''