diff --git a/bsp/stm32/stm32l053-st-nucleo/README.md b/bsp/stm32/stm32l053-st-nucleo/README.md index 35799d27155cc0cfce7365695928dbaad8d11a21..424ec19c46727dad05bd5894c6f7b5c780d01ea5 100644 --- a/bsp/stm32/stm32l053-st-nucleo/README.md +++ b/bsp/stm32/stm32l053-st-nucleo/README.md @@ -1,115 +1,96 @@ -# NUCLEO-L053R8 开发板 BSP 说明 - -## 简介 - -本文档为ST官方 NUCLEO-L053R8 开发板的 BSP (板级支持包) 说明。 - -主要内容如下: - -- 开发板资源介绍 -- BSP 快速上手 -- 进阶使用方法 - -通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。 - -## 开发板介绍 - -NUCLEO-L053R8 开发板是 ST 官方推出的一款基于 ARM Cortex-M0+ 内核的开发板,绿色的 Nucleo 标志显示了这款芯片是低功耗系列,板载 ST-LINK/V2-1 调试器/编程器,该开发板具有丰富的扩展接口,且与Arduino™ nano 接口兼容,可以方便验证 STM32L053R8 芯片的性能。 - -开发板外观如下图所示: - -![board](figures/board.jpg) - -该开发板常用 **板载资源** 如下: - -- MCU:STM32L053R8,主频 32MHz,64KB FLASH ,8KB RAM -- 常用外设 - - LED:3个,USB communication(LD1 双色),power LED(LD3 红色),user LED(LD2 黄色) - - 按键:1个,B1(兼具唤醒功能,PC13),B2(RESET) -- 常用接口:USB 支持 3 种不同接口:虚拟 COM 端口、大容量存储和调试端口;arduino 接口等 -- 调试接口:标准 SWD - -开发板更多详细信息请参考【STMicroelectronics】 [NUCLEO-L053R8](https://www.st.com/en/evaluation-tools/nucleo-l053r8.html)。 - -## 外设支持 - -本 BSP 目前对外设的支持情况如下: - -| **板载外设** | **支持情况** | **备注** | -| :----------------- | :----------: | :------------------------------------- | -| 板载 ST-LINK 转串口 | 支持 | | -| **片上外设** | **支持情况** | **备注** | -| GPIO | 支持 | PA0, PA1... PC15 ---> PIN: 0, 1...47 | -| UART | 支持 | UART2 | -| SPI | 暂不支持 | SPI1 即将支持 | -| I2C | 暂不支持 | 软件 I2C 即将支持 | -| RTC | 暂不支持 | 即将支持 | -| PWM | 暂不支持 | 即将支持 | -| USB Device | 暂不支持 | 即将支持 | -| IWG | 暂不支持 | 即将支持 | -| **扩展模块** | **支持情况** | **备注** | - -## 使用说明 - -使用说明分为如下两个章节: - -- 快速上手 - - 本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。 - -- 进阶使用 - - 本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。 - - -### 快速上手 - -本 BSP 为开发者提供 MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。 - -#### 硬件连接 - -使用数据线连接开发板到 PC,打开电源开关。 - -#### 编译下载 - -双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。 - -> 工程默认配置使用 ST-LINK 仿真器下载程序,在通过 microUSB 连接开发板的基础上,点击下载按钮即可下载程序到开发板 - -#### 运行结果 - -下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LD1 和 LD3 常亮、黄色 LD2 会周期性闪烁。 - -USB 虚拟 COM 端口默认连接串口 2,在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息: - -```bash - \ | / -- RT - Thread Operating System - / | \ 4.0.0 build Jan 9 2019 - 2006 - 2018 Copyright by rt-thread team -msh > -``` -### 进阶使用 - -此 BSP 默认只开启了 GPIO 和 串口 2 的功能,如果需使用更多高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下: - -1. 在 bsp 下打开 env 工具。 - -2. 输入`menuconfig`命令配置工程,配置好之后保存退出。 - -3. 输入`pkgs --update`命令更新软件包。 - -4. 输入`scons --target=mdk5/iar` 命令重新生成工程。 - -本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。 - -## 注意事项 - -- 开机时如果不能打印 RT-Thread 版本信息,请将BSP中串口 GPIO 速率调低 -- 开机时如果不能打印 RT-Thread 版本信息,请重新选择 PC 端串口调试软件的串口号 - -## 联系人信息 - -维护人: - -- [sun_shine](https://github.com/sunshine0824), 邮箱: +# STM32L053-Nucleo BSP Introduction + +[中文](README_zh.md) + +## MCU: STM32L053R8 @32MHz, 64KB FLASH, 8KB RAM + +The 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. + +The 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. +The 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. +Moreover, 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. +The STM32L053x6/8 also include a real-time clock and a set of backup registers that remain powered in Standby mode. +Finally, 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. +The 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. + +#### KEY FEATURES + +- Ultra-low-power platform + - 1.65 V to 3.6 V power supply + - -40 to 125 °C temperature range + - 0.27 μA Standby mode (2 wakeup pins) + - 0.4 μA Stop mode (16 wakeup lines) + - 0.8 μA Stop mode + RTC + 8 KB RAM retention + - 88 μA/MHz in Run mode + - 3.5 μs wakeup time (from RAM) + - 5 μs wakeup time (from Flash memory) +- Core: Arm® 32-bit Cortex®-M0+ with MPU + - From 32 kHz up to 32 MHz max. + - 0.95 DMIPS/MHz +- Memories + - Up to 64 KB Flash memory with ECC + - 8KB RAM + - 2 KB of data EEPROM with ECC + - 20-byte backup register + - Sector protection against R/W operation +- Up to 51 fast I/Os (45 I/Os 5V tolerant) +- Reset and supply management + - Ultra-safe, low-power BOR (brownout reset) with 5 selectable thresholds + - Ultra-low-power POR/PDR + - Programmable voltage detector (PVD) +- Clock sources + - 1 to 25 MHz crystal oscillator + - 32 kHz oscillator for RTC with calibration + - High speed internal 16 MHz factory-trimmed RC (+/- 1%) + - Internal low-power 37 kHz RC + - Internal multispeed low-power 65 kHz to 4.2 MHz RC + - PLL for CPU clock +- Pre-programmed bootloader + - USART, SPI supported +- Development support + - Serial wire debug supported +- LCD driver for up to 8×28segments + - Support contrast adjustment + - Support blinking mode + - Step-up converted on board + +- Rich Analog peripherals + - 12-bit ADC 1.14 Msps up to 16 channels (down to 1.65 V) + - 12-bit 1 channel DAC with output buffers (down to 1.8 V) + - 2x ultra-low-power comparators (window mode and wake up capability, down to 1.65 V) +- Up to 24 capacitive sensing channels supporting touchkey, linear and rotary touch sensors +- 7-channel DMA controller, supporting ADC, SPI, I2C, USART, DAC, Timers +- 8x peripheral communication interfaces + - 1x USB 2.0 crystal-less, battery charging detection and LPM + - 2x USART (ISO 7816, IrDA), 1x UART (low power) + - Up to 4x SPI 16 Mbits/s + - 2x I2C (SMBus/PMBus) +- 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) +- CRC calculation unit, 96-bit unique ID +- True RNG and firewall protection +- All packages are ECOPACK®2 + + + +## Read more + +| Documents | Description | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [STM32_Nucleo-64_BSP_Introduction](../docs/STM32_Nucleo-64_BSP_Introduction.md) | How to run RT-Thread on STM32 Nucleo-64 boards (**Must-Read**) | +| [STM32L053R8 ST Official Website](https://www.st.com/en/microcontrollers-microprocessors/stm32l053r8.html#documentation) | STM32L053R8 datasheet and other resources | + + + +## Maintained By + + [sun_shine](https://github.com/xupenghu), + + + +## Translated By + +Meco Man @ RT-Thread Community + +> jiantingman@foxmail.com +> +> https://github.com/mysterywolf \ No newline at end of file diff --git a/bsp/stm32/stm32l053-st-nucleo/README_zh.md b/bsp/stm32/stm32l053-st-nucleo/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..35799d27155cc0cfce7365695928dbaad8d11a21 --- /dev/null +++ b/bsp/stm32/stm32l053-st-nucleo/README_zh.md @@ -0,0 +1,115 @@ +# NUCLEO-L053R8 开发板 BSP 说明 + +## 简介 + +本文档为ST官方 NUCLEO-L053R8 开发板的 BSP (板级支持包) 说明。 + +主要内容如下: + +- 开发板资源介绍 +- BSP 快速上手 +- 进阶使用方法 + +通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。 + +## 开发板介绍 + +NUCLEO-L053R8 开发板是 ST 官方推出的一款基于 ARM Cortex-M0+ 内核的开发板,绿色的 Nucleo 标志显示了这款芯片是低功耗系列,板载 ST-LINK/V2-1 调试器/编程器,该开发板具有丰富的扩展接口,且与Arduino™ nano 接口兼容,可以方便验证 STM32L053R8 芯片的性能。 + +开发板外观如下图所示: + +![board](figures/board.jpg) + +该开发板常用 **板载资源** 如下: + +- MCU:STM32L053R8,主频 32MHz,64KB FLASH ,8KB RAM +- 常用外设 + - LED:3个,USB communication(LD1 双色),power LED(LD3 红色),user LED(LD2 黄色) + - 按键:1个,B1(兼具唤醒功能,PC13),B2(RESET) +- 常用接口:USB 支持 3 种不同接口:虚拟 COM 端口、大容量存储和调试端口;arduino 接口等 +- 调试接口:标准 SWD + +开发板更多详细信息请参考【STMicroelectronics】 [NUCLEO-L053R8](https://www.st.com/en/evaluation-tools/nucleo-l053r8.html)。 + +## 外设支持 + +本 BSP 目前对外设的支持情况如下: + +| **板载外设** | **支持情况** | **备注** | +| :----------------- | :----------: | :------------------------------------- | +| 板载 ST-LINK 转串口 | 支持 | | +| **片上外设** | **支持情况** | **备注** | +| GPIO | 支持 | PA0, PA1... PC15 ---> PIN: 0, 1...47 | +| UART | 支持 | UART2 | +| SPI | 暂不支持 | SPI1 即将支持 | +| I2C | 暂不支持 | 软件 I2C 即将支持 | +| RTC | 暂不支持 | 即将支持 | +| PWM | 暂不支持 | 即将支持 | +| USB Device | 暂不支持 | 即将支持 | +| IWG | 暂不支持 | 即将支持 | +| **扩展模块** | **支持情况** | **备注** | + +## 使用说明 + +使用说明分为如下两个章节: + +- 快速上手 + + 本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。 + +- 进阶使用 + + 本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。 + + +### 快速上手 + +本 BSP 为开发者提供 MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。 + +#### 硬件连接 + +使用数据线连接开发板到 PC,打开电源开关。 + +#### 编译下载 + +双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。 + +> 工程默认配置使用 ST-LINK 仿真器下载程序,在通过 microUSB 连接开发板的基础上,点击下载按钮即可下载程序到开发板 + +#### 运行结果 + +下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LD1 和 LD3 常亮、黄色 LD2 会周期性闪烁。 + +USB 虚拟 COM 端口默认连接串口 2,在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息: + +```bash + \ | / +- RT - Thread Operating System + / | \ 4.0.0 build Jan 9 2019 + 2006 - 2018 Copyright by rt-thread team +msh > +``` +### 进阶使用 + +此 BSP 默认只开启了 GPIO 和 串口 2 的功能,如果需使用更多高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下: + +1. 在 bsp 下打开 env 工具。 + +2. 输入`menuconfig`命令配置工程,配置好之后保存退出。 + +3. 输入`pkgs --update`命令更新软件包。 + +4. 输入`scons --target=mdk5/iar` 命令重新生成工程。 + +本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。 + +## 注意事项 + +- 开机时如果不能打印 RT-Thread 版本信息,请将BSP中串口 GPIO 速率调低 +- 开机时如果不能打印 RT-Thread 版本信息,请重新选择 PC 端串口调试软件的串口号 + +## 联系人信息 + +维护人: + +- [sun_shine](https://github.com/sunshine0824), 邮箱: