rt-thread/bsp/stm32f10x
chenchaoqun@rt-thread.com 6ae6ba1469 [bsp][stm32f10x][adapt] to serial frame about dma 2019-01-03 10:23:10 +08:00
..
Libraries Re-normalizing the repo 2013-01-08 22:40:58 +08:00
applications [license] Change the license to Apache 2018-10-16 14:18:50 +08:00
drivers [bsp][stm32f10x][adapt] to serial frame about dma 2019-01-03 10:23:10 +08:00
.config 【修改】.config 中RT_SERIAL_USING_DMA选项 2018-12-17 09:53:44 +08:00
Kconfig [BSP] Add Kconfig for lpc408x/stm32f10x/stm32f20x/stm32f40x etc 2018-03-04 22:35:07 +08:00
README.md [Bsp]Add Readme for stm32f10x 2018-05-31 09:36:59 +08:00
SConscript update stm32f10x project directory structure. 2013-07-12 18:16:43 +08:00
SConstruct update stm32f10x project directory structure. 2013-07-12 18:16:43 +08:00
project.ewp [bsp][stm32f10x] update projects 2018-03-16 11:18:53 +08:00
project.eww update stm32f10x project. 2013-07-12 18:31:42 +08:00
project.uvproj [bsp][stm32f10x] update projects 2018-03-16 11:18:53 +08:00
project.uvprojx [bsp][stm32f10x] : unable to use microlib 2018-04-20 09:53:51 +08:00
readme.txt [bsp] Add some descriptions and an English version about building project in readme.txt. 2017-08-04 18:21:34 +08:00
rtconfig.h 【串口】宏定义对应增加 2018-12-17 09:38:53 +08:00
rtconfig.py [bsp] support get compiler path by environment variables for IAR 2018-04-07 15:43:45 +08:00
stm32_rom.ld update linker script for components auto initial. 2013-07-11 23:07:16 +08:00
stm32_rom.sct revert stm32_rom.sct 2011-07-04 07:52:55 +00:00
stm32f10x_flash.icf [BSP] Fix component initialization functions may be not sequential storage on ROM when used for IAR linker. 2017-07-27 13:58:07 +08:00
template.ewp define RT_USING_RTT_CMSIS in rtconfig.h while using IAR 6.30+ 2012-06-18 03:00:01 +00:00
template.uvproj fix keil armcc compiling report "Error: expected an expression" 2015-12-10 21:47:53 +08:00
template.uvprojx [bsp][stm32f10x] : unable to use microlib 2018-04-20 09:53:51 +08:00

README.md

STM32F10x 板级支持包

1. 简介

STM32F1 是由意法半导体推出的Cortex-M3内核的高性能单片机 包括如下硬件特性:

硬件 描述
芯片型号 STM32F10x全系列
CPU Cortex-M3
主频 48MHz-72MHz

2. 编译说明

环境 说明
PC操作系统 Linux/MacOS/Windows
编译器 arm-none-eabi-gcc version 6.3.1 20170620 (release)/armcc/iar
构建工具 scons/mdk5/iar
依赖软件环境 Env工具/(MDK或IAR或arm-none-eabi-gcc)/git/调试器驱动
  1. 下载源码
    git clone https://github.com/RT-Thread/rt-thread.git
  1. 配置工程并准备env

Linux/Mac

    cd rt-thread/bsp/stm32f10x
    scons --menuconfig
    source ~/.env/env.sh
    pkgs --upgrade

Windows

RT-Thread官网下载ENV工具包

  1. 配置芯片型号

Linux/Mac

    scons --menuconfig

Windows(ENV环境中)

    menuconfig

在menuconfig页面配置并选择对应的芯片型号若开发环境为MDK/IAR则需要生成工程

  1. 生成工程(Mac/Linux下请跳过此步骤)

Windows IAR

    SET RTT_CC=iar
    scons --target=iar -s

Windows MDK5

    scons --target=mdk5 -s

Windows MDK4

    scons --target=mdk4 -s
  1. 编译

使用MDK或IAR请参见对应教程

Windows arm-none-eabi-gcc 使用以下指令设置gcc路径

    SET RTT_EXEC_PATH=[GCC路径]

Linux/Mac arm-none-eabi-gcc 使用以下指令设置gcc路径

    export RTT_EXEC_PATH=[GCC路径]

编译WindowsLinux/Mac arm-none-eabi-gcc

    scons -j4

出现下列信息即为编译成功

    LINK rtthread-stm32.elf
    arm-none-eabi-objcopy -O binary rtthread-stm32.elf rtthread.bin
    arm-none-eabi-size rtthread-stm32.elf
    text    data     bss     dec     hex filename
    46356     424    1520   48300    bcac rtthread-stm32.elf
    scons: done building targets.

如果编译正确无误会产生rtthread-stm32.elf、rtthread.bin文件。其中rtthread.bin为二进制固件

3. 烧写及执行

烧写可以使用仿真器 ISP等多种方式 此处不再赘述

3.1 运行结果

如果编译 & 烧写无误会在串口2*上看到RT-Thread的启动logo信息

 \ | /
- RT -     Thread Operating System
 / | \     3.0.4 build May 15 2018
 2006 - 2018 Copyright by rt-thread team
msh />

*默认串口

4. 驱动支持情况及计划

驱动 支持情况 备注
UART 支持 UART1/2/3/4
GPIO 支持 /

4.1 IO在板级支持包中的映射情况

IO号 板级包中的定义
PA9 USART1 TX
PA10 USART1 RX
PA2 USART2 TX
PA3 USART2 RX
PB10 USART3 TX
PB11 USART3 RX
PC10 UART4 TX
PC11 UART4 RX

5. menuconfig Bsp菜单详解

选项 解释
Enable UART1 (PA9/10) 开启串口1串口1的设备名为"uart1"
Enable UART2 (PA2/3) 开启串口2串口1的设备名为"uart2"
Enable UART3 (PB10/11) 开启串口3串口1的设备名为"uart3"
Enable UART4 (PC10/11) 开启串口4串口1的设备名为"uart4"

*部分选项需要在RT-Thread组件菜单中开启对应的设备框架才能显示。

6. 联系人信息

维护人: uestczyh222 < lymz@foxmail.com >