README.md
1# STM32L053-Nucleo BSP Introduction
2
3[中文](README_zh.md)
4
5## MCU: STM32L053R8 @32MHz, 64KB FLASH, 8KB RAM
6
7The ultra-low-power STM32L053x6/8 microcontrollers incorporate the connectivity power of the universal serial bus (USB 2.0 crystal-less) with the high-performance Arm® Cortex®-M0+ 32-bit RISC core operating at a 32 MHz frequency, a memory protection unit (MPU), high-speed embedded memories (up to 64 Kbytes of Flash program memory, 2 Kbytes of data EEPROM and 8 Kbytes of RAM) plus an extensive range of enhanced I/Os and peripherals.
8
9The STM32L053x6/8 devices provide high power efficiency for a wide range of performance. It is achieved with a large choice of internal and external clock sources, an internal voltage adaptation and several low-power modes.
10The STM32L053x6/8 devices offer several analog features, one 12-bit ADC with hardware oversampling, one DAC, two ultra-low-power comparators, several timers, one low-power timer (LPTIM), three general-purpose 16-bit timers and one basic timer, one RTC and one SysTick which can be used as timebases. They also feature two watchdogs, one watchdog with independent clock and window capability and one window watchdog based on bus clock.
11Moreover, the STM32L053x6/8 devices embed standard and advanced communication interfaces: up to two I2C, two SPIs, one I2S, two USARTs, a low-power UART (LPUART), and a crystal-less USB. The devices offer up to 24 capacitive sensing channels to simply add touch sensing functionality to any application.
12The STM32L053x6/8 also include a real-time clock and a set of backup registers that remain powered in Standby mode.
13Finally, their integrated LCD controller has a built-in LCD voltage generator that allows to drive up to 8 multiplexed LCDs with contrast independent of the supply voltage.
14The ultra-low-power STM32L053x6/8 devices operate from a 1.8 to 3.6 V power supply (down to 1.65 V at power down) with BOR and from a 1.65 to 3.6 V power supply without BOR option. They are available in the -40 to +125 °C temperature range. A comprehensive set of power-saving modes allows the design of low-power applications.
15
16#### KEY FEATURES
17
18- Ultra-low-power platform
19 - 1.65 V to 3.6 V power supply
20 - -40 to 125 °C temperature range
21 - 0.27 μA Standby mode (2 wakeup pins)
22 - 0.4 μA Stop mode (16 wakeup lines)
23 - 0.8 μA Stop mode + RTC + 8 KB RAM retention
24 - 88 μA/MHz in Run mode
25 - 3.5 μs wakeup time (from RAM)
26 - 5 μs wakeup time (from Flash memory)
27- Core: Arm® 32-bit Cortex®-M0+ with MPU
28 - From 32 kHz up to 32 MHz max.
29 - 0.95 DMIPS/MHz
30- Memories
31 - Up to 64 KB Flash memory with ECC
32 - 8KB RAM
33 - 2 KB of data EEPROM with ECC
34 - 20-byte backup register
35 - Sector protection against R/W operation
36- Up to 51 fast I/Os (45 I/Os 5V tolerant)
37- Reset and supply management
38 - Ultra-safe, low-power BOR (brownout reset) with 5 selectable thresholds
39 - Ultra-low-power POR/PDR
40 - Programmable voltage detector (PVD)
41- Clock sources
42 - 1 to 25 MHz crystal oscillator
43 - 32 kHz oscillator for RTC with calibration
44 - High speed internal 16 MHz factory-trimmed RC (+/- 1%)
45 - Internal low-power 37 kHz RC
46 - Internal multispeed low-power 65 kHz to 4.2 MHz RC
47 - PLL for CPU clock
48- Pre-programmed bootloader
49 - USART, SPI supported
50- Development support
51 - Serial wire debug supported
52- LCD driver for up to 8×28segments
53 - Support contrast adjustment
54 - Support blinking mode
55 - Step-up converted on board
56
57- Rich Analog peripherals
58 - 12-bit ADC 1.14 Msps up to 16 channels (down to 1.65 V)
59 - 12-bit 1 channel DAC with output buffers (down to 1.8 V)
60 - 2x ultra-low-power comparators (window mode and wake up capability, down to 1.65 V)
61- Up to 24 capacitive sensing channels supporting touchkey, linear and rotary touch sensors
62- 7-channel DMA controller, supporting ADC, SPI, I2C, USART, DAC, Timers
63- 8x peripheral communication interfaces
64 - 1x USB 2.0 crystal-less, battery charging detection and LPM
65 - 2x USART (ISO 7816, IrDA), 1x UART (low power)
66 - Up to 4x SPI 16 Mbits/s
67 - 2x I2C (SMBus/PMBus)
68- 9x timers: 1x 16-bit with up to 4 channels, 2x 16-bit with up to 2 channels, 1x 16-bit ultra-low-power timer, 1x SysTick, 1x RTC, 1x 16-bit basic for DAC, and 2x watchdogs (independent/window)
69- CRC calculation unit, 96-bit unique ID
70- True RNG and firewall protection
71- All packages are ECOPACK®2
72
73
74
75## Read more
76
77| Documents | Description |
78| :----------------------------------------------------------: | :----------------------------------------------------------: |
79| [STM32_Nucleo-64_BSP_Introduction](../docs/STM32_Nucleo-64_BSP_Introduction.md) | How to run RT-Thread on STM32 Nucleo-64 boards (**Must-Read**) |
80| [STM32L053R8 ST Official Website](https://www.st.com/en/microcontrollers-microprocessors/stm32l053r8.html#documentation) | STM32L053R8 datasheet and other resources |
81
82
83
84## Maintained By
85
86 [sun_shine](https://github.com/xupenghu), <baozitai@163.com>
87
88
89
90## Translated By
91
92Meco Man @ RT-Thread Community
93
94> jiantingman@foxmail.com
95>
96> https://github.com/mysterywolf
README_zh.md
1# NUCLEO-L053R8 开发板 BSP 说明
2
3## 简介
4
5本文档为ST官方 NUCLEO-L053R8 开发板的 BSP (板级支持包) 说明。
6
7主要内容如下:
8
9- 开发板资源介绍
10- BSP 快速上手
11- 进阶使用方法
12
13通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。
14
15## 开发板介绍
16
17NUCLEO-L053R8 开发板是 ST 官方推出的一款基于 ARM Cortex-M0+ 内核的开发板,绿色的 Nucleo 标志显示了这款芯片是低功耗系列,板载 ST-LINK/V2-1 调试器/编程器,该开发板具有丰富的扩展接口,且与Arduino™ nano 接口兼容,可以方便验证 STM32L053R8 芯片的性能。
18
19开发板外观如下图所示:
20
21
22
23该开发板常用 **板载资源** 如下:
24
25- MCU:STM32L053R8,主频 32MHz,64KB FLASH ,8KB RAM
26- 常用外设
27 - LED:3个,USB communication(LD1 双色),power LED(LD3 红色),user LED(LD2 黄色)
28 - 按键:1个,B1(兼具唤醒功能,PC13),B2(RESET)
29- 常用接口:USB 支持 3 种不同接口:虚拟 COM 端口、大容量存储和调试端口;arduino 接口等
30- 调试接口:标准 SWD
31
32开发板更多详细信息请参考【STMicroelectronics】 [NUCLEO-L053R8](https://www.st.com/en/evaluation-tools/nucleo-l053r8.html)。
33
34## 外设支持
35
36本 BSP 目前对外设的支持情况如下:
37
38| **板载外设** | **支持情况** | **备注** |
39| :----------------- | :----------: | :------------------------------------- |
40| 板载 ST-LINK 转串口 | 支持 | |
41| **片上外设** | **支持情况** | **备注** |
42| GPIO | 支持 | PA0, PA1... PC15 ---> PIN: 0, 1...47 |
43| UART | 支持 | UART2 |
44| SPI | 暂不支持 | SPI1 即将支持 |
45| I2C | 暂不支持 | 软件 I2C 即将支持 |
46| RTC | 暂不支持 | 即将支持 |
47| PWM | 暂不支持 | 即将支持 |
48| USB Device | 暂不支持 | 即将支持 |
49| IWG | 暂不支持 | 即将支持 |
50| **扩展模块** | **支持情况** | **备注** |
51
52## 使用说明
53
54使用说明分为如下两个章节:
55
56- 快速上手
57
58 本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
59
60- 进阶使用
61
62 本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
63
64
65### 快速上手
66
67本 BSP 为开发者提供 MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
68
69**请注意!!!**
70
71在执行编译工作前请先打开ENV执行以下指令(该指令用于拉取必要的HAL库及CMSIS库,否则无法通过编译):
72
73```bash
74pkgs --update
75```
76
77#### 硬件连接
78
79使用数据线连接开发板到 PC,打开电源开关。
80
81#### 编译下载
82
83双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
84
85> 工程默认配置使用 ST-LINK 仿真器下载程序,在通过 microUSB 连接开发板的基础上,点击下载按钮即可下载程序到开发板
86
87#### 运行结果
88
89下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LD1 和 LD3 常亮、黄色 LD2 会周期性闪烁。
90
91USB 虚拟 COM 端口默认连接串口 2,在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
92
93```bash
94 \ | /
95- RT - Thread Operating System
96 / | \ 4.0.0 build Jan 9 2019
97 2006 - 2018 Copyright by rt-thread team
98msh >
99```
100### 进阶使用
101
102此 BSP 默认只开启了 GPIO 和 串口 2 的功能,如果需使用更多高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
103
1041. 在 bsp 下打开 env 工具。
105
1062. 输入`menuconfig`命令配置工程,配置好之后保存退出。
107
1083. 输入`pkgs --update`命令更新软件包。
109
1104. 输入`scons --target=mdk5/iar` 命令重新生成工程。
111
112本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。
113
114## 注意事项
115
116- 开机时如果不能打印 RT-Thread 版本信息,请将BSP中串口 GPIO 速率调低
117- 开机时如果不能打印 RT-Thread 版本信息,请重新选择 PC 端串口调试软件的串口号
118
119## 联系人信息
120
121维护人:
122
123- [sun_shine](https://github.com/sunshine0824), 邮箱:<baozitai@163.com>
124