Keil STM32L0xx_DFP STMicroelectronics STM32L0 Series Device Support https://www.keil.com/pack/ https://github.com/Open-CMSIS-Pack/STM32L0xx_DFP.git LICENSE Active development ... Updated STM32Cube FW to STM32Cube_FW_L0_V1.12.2 (HAL V1.10.6). Package Description (pdsc): - Moved global define USE_HAL_DRIVER to the component Standalone:Device:STM32Cube HAL:COMMON - Moved global define USE_FULL_LL_DRIVER to the component Standalone:Device:STM32Cube LL:COMMON Device support: - Updated documentation - System View Description files added and updated - Flash Option Bytes template files can be added to the project as a user template Board Examples: - Updated with latest api definiton for STM32Cube Framework component - Updated to STM32Cube_FW_L0_V1.12.2 - Updated to fixed pack versions - Added 32L0538DISCOVERY README.md file - Templates: -- Overwritten default HAL_InitTick function CMSIS-Driver: - I2C: -- Corrected Transmit and Receive functions busy flag handling -- Corrected MasterTransmit and MasterReceive functions when not generating STOP condition (when xfer_pending is "true") -- Corrected GetDataCount function operation when DMA is used -- Corrected Bus Clear functionality -- Updated check if I2C peripheral is enabled in the CubeMx and improved user experience if it is not enabled -- Added DMA functionality for Slave transfers -- Added internal function to retrieve peripheral clock - UART: -- Added LPUART1 interface accessed by Driver_USART11. Updated STM32Cube FW to STM32Cube_FW_L0_V1.12.1 (HAL V1.10.5). STM32CubeMX integration: - Synchronized versions of generated component ::Device:STM32Cube Framework:STM32CubeMX (in gpdsc) and its bootstrap (in pdsc). Device support: - Updated Subfamilies: STM32L010/STM32L011/STM32L071/STM32L072/STM32L083. - Updated SVD files and Documentation. Package Description (pdsc): - Updated schemaVersion (1.7.2). - Removed Cversion from the components enclosed in a bundle. - Corrected device in board description attribute 'mountedDevice'. - Added debugProbe board description. - Added global define USE_HAL_DRIVER and USE_FULL_LL_DRIVER to the component ::Device:STM32Cube Framework:STM32CubeMX. - Added global define USE_HAL_DRIVER and USE_FULL_LL_DRIVER to the component ::Device:STM32Cube HAL:COMMON. CMSIS-Driver: - Updated disclaimers. - I2C: -- Corrected pins configuration. -- Synchronized to HAL V1.10.5. - USBD: -- Removed include of stm32l0xx_hal_pcd.h header. Examples: - Changed Assembler option to armclang(Auto Select). - Updated config files to CMSIS 5.8.0. STM32CubeMX integration: - Added support for using Timebase Source TIMx (FrameworkCubeMX_gpdsc.ftl) Device support: - Added capability to launch the Option Byte Loading after a Flash Download. - Updated STM32L0xx devices. - Updated STM32Cube FW to STM32Cube_FW_L0_V1.11.2 (HAL V1.10.2) - Updated SVD files. - Updated documentation. CMSIS-Driver: - Spi: Corrected compiler warning in driver source code. - USB Device: Corrected USBD_EndpointConfigure function (check that maximum packet size requested fits into configured FIFO). Example projects: - Terminating app_main thread with osThreadExit() to avoid endless loop. - USB Device examples: -- Added Event Recorder in USB Device examples (for STM32L073Z-EVAL board). -- Updated with user code templates from MDK-Middleware v7.11.1. Device support: - Added STM32L010 devices. - Updated STM32L0 HAL to V1.10.0 - Updated documentation. - updated Flash Option assembler file. CMSIS-Driver: - USB Device: -- Updated USBD_EndpointConfigure function to check that maximum packet size requested fits into configured FIFO (compile time configured). - USB Device: Corrected transmitted count for non-control IN endpoints - USART: Corrected UARTx/USARTx related typing mistakes Corrected: launching STM32CubeMX via "play" button for existing projects overwrites with a new STM32CubeMX project file instead of loading it. MX_Device_h.ftl: - Updated parsing of USART virtual mode - Updated generation of macros: Added handling for '(' and ')' symbols This DFP works either with STM32CubeMX (STM32CubeMX V4.23.0 and STM32Cube_FW_L0 V1.10.0 or higher) or Standalone (no support for STM32CubeMX). STM32CubeMX is mandatory for use of CMSIS-Driver and MDK-Middleware. - New projects require the component 'Device:STM32Cube Framework:STM32CubeMX' from the STM32Cube MX bundle for configuration of pins and clocks via STM32CubeMX. This pack only contains a subset of the files from STM32Cube_FW_L0 version 1.10.0 (ST Drivers, STM32Cube documentation and fonts). Updated documentation for STM32Cube Framework usage. Device support: - Updated device names to match STM32CubeMX notation. - Updated core option MPU/NO_MPU. - Added DBGMCU INI files configuring debug settings of the target for debug units without support for debug sequences. - Updated SVD files. - Updated documentation. CMSIS Driver: - Added I2C driver. - Added SPI driver. - Added UART/USART/IrDA/SmartCard driver. - Added USB Device driver. Board support: - Added STM32L073Z-EVAL. - Updated Board Support LED driver for STM32L053-Discovery. Example projects: - Added USB Device HID and MassStorage on STM32L073Z-EVAL Board. Added devices STM32L041E6, STM32L082CZY. Corrected system_stm32l0xx.c (function SystemCoreClockUpdate() ). Aligned devices with STM32CubeMx v4.15.0. Updated device support files to STM32Cube Firmware Library (V 1.6.0). Corrected system_stm32l0xx.c. Aligned devices with list of STM32Cube Firmware Library (V 1.5.0). Corrected RAM1 according data sheets Updated documentation Updated SVD files fixing name of Bit9 of PWR Peripheral CR Register Added subfamilies STM32L011/21, STM32L031/41, STM32L071/72/73, STM32L081/82/83. Added Option Byte (OPT), EEPROM Flash Algorithm. Updated STM32L0xx device support files. Updated user manuals, datasheets. Updated RTX Blinky examples. Added Board Support for STM32L053-Discovery board. Reworked STM32L0xx Flash Programming Algorithm to improve programming speed. Added devices STM32L051T6, STM32L051T8, STM32L052T6, STM32L052T8. Added SVD files. Updated documentation. Removed ST-Link Add-On installer from PACK First Release version of STM32L0 Device Family Pack. ST Device Support Device Family Package STMicroelectronics STM32L0 STM32L0xx Ultra-low-power STM32L0 MCUs with Arm Cortex-M0+ core, MPU, 0.95 DMIPS at 32 MHz. Sequence("CheckID"); // Replication of Standard Functionality Write32(0xE000EDF0, 0xA05F0001); // Enable Core Debug via DHCSR // Device Specific Debug Setup Write32(0x40021034, Read32(0x40021034) | 0x00400000); // Set RCC_APB2ENR.DBGEN Write32(0x40015804, DbgMCU_CR); // DBGMCU_CR: Configure MCU Debug Write32(0x40015808, DbgMCU_APB1_Fz); // DBGMCU_APB1_FZ: Configure APB1 Peripheral Freeze Behavior Write32(0x4001580C, DbgMCU_APB2_Fz); // DBGMCU_APB1_FZ: Configure APB2 Peripheral Freeze Behavior __var pidr1 = 0; __var pidr2 = 0; __var jep106id = 0; __var ROMTableBase = 0; __ap = 0; // AHB-AP ROMTableBase = ReadAP(0xF8) & ~0x3; pidr1 = Read32(ROMTableBase + 0x0FE4); pidr2 = Read32(ROMTableBase + 0x0FE8); jep106id = ((pidr2 & 0x7) << 4 ) | ((pidr1 >> 4) & 0xF); Query(0, "Not a genuine ST Device! Abort connection", 1); Message(2, "Not a genuine ST Device! Abort connection."); __var connectionFlash = ( __connection & 0xF ) == 2 ; __var FLASH_BASE = 0x40022000 ; __var FLASH_CR = FLASH_BASE + 0x04 ; __var OBL_LAUNCH_BIT = ( 1 << 18 ) ; __var LOCK_BIT = ( 1 << 0 ) ; __var OPTLOCK_BIT = ( 1 << 2 ) ; __var FLASH_KEYR = FLASH_BASE + 0x0C ; __var FLASH_KEY1 = 0x89ABCDEF ; __var FLASH_KEY2 = 0x02030405 ; __var FLASH_OPTKEYR = FLASH_BASE + 0x14 ; __var FLASH_OPTKEY1 = 0xFBEAD9C8 ; __var FLASH_OPTKEY2 = 0x24252627 ; __var FLASH_CR_Value = 0 ; __var DoDebugPortStop = 1 ; __var DP_CTRL_STAT = 0x4 ; __var DP_SELECT = 0x8 ; // unlock the FLASH_CR Write32( FLASH_KEYR, FLASH_KEY1 ) ; Write32( FLASH_KEYR, FLASH_KEY2 ) ; // unlock the option byte block Write32( FLASH_OPTKEYR, FLASH_OPTKEY1 ) ; Write32( FLASH_OPTKEYR, FLASH_OPTKEY2 ) ; FLASH_CR_Value = Read32( FLASH_CR ) ; DoDebugPortStop = 0 ; __errorcontrol = 1 ; // write OBL_LAUNCH bit (causes a reset) Write32( FLASH_CR, FLASH_CR_Value | ( OBL_LAUNCH_BIT ) ) ; __errorcontrol = 0 ; // Switch to DP Register Bank 0 WriteDP(DP_SELECT, 0x00000000); // Power Down Debug port WriteDP(DP_CTRL_STAT, 0x00000000); __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0x80201801; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled __var DbgMCU_CR = 0x00000006; // DBGMCU_CR: DBG_STOP, DBG_STANDBY __var DbgMCU_APB1_Fz = 0xC0201833; // DGBMCU_APB1_FZ: Configure APB1 peripheral freeze behavior __var DbgMCU_APB2_Fz = 0x00000024; // DGBMCU_APB2_FZ: Configure APB2 peripheral freeze behavior __var DoOptionByteLoading = 0; // Disabled STMicroelectronics STM32L0 Series devices STMicroelectronics STM32L0 Device and CMSIS-CORE Configuration via STM32CubeMX #define RTE_DEVICE_CUBE_MX #define CMSIS_device_header "stm32l0xx.h"