没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐

April 2020 AN4657 Rev 2 1/16
1
AN4657
Application note
STM32 in-application programming (IAP) using the USART
Introduction
An important requirement for most Flash-memory-based systems is the ability to update
firmware when installed in the end product. This ability is referred to as in-application
programming (IAP).
Most newer STM32 microcontrollers are supported by middleware open source library
called Open Bootloader (OpenBL).
More information on OpenBL is available for example in USART protocol used in the STM32
bootloader (AN3155).
The purpose of this application note is to provide general guidelines for creating an IAP
application on older STM32 microcontrollers not supported by the OpenBL.
An STM32 microcontroller is able to run user-specific firmware to perform an IAP of the
Flash memory embedded in the microcontroller. This feature uses any communication
interface available and supported by the product. The USART using the Ymodem protocol is
the example taken in this application note.
The X-CUBE-IAP-USART firmware package is delivered with this document and contains
the source code of IAP examples for STM32 microcontrollers. It is available from
www.st.com.
www.st.com

Contents AN4657
2/16 AN4657 Rev 2
Contents
1 IAP overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 IAP driver example description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 IAP driver flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Running the IAP driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 Tera Term configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 IAP driver menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 Downloading an image into the internal Flash memory . . . . . . . . . . . . . . 10
3.2 Uploading an image from the internal Flash memory . . . . . . . . . . . . . . . . .11
3.3 Executing the new program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
3.4 Configuring the write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
4 IAP implementation summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5 User program conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

List of figures AN4657
4/16 AN4657 Rev 2
List of figures
Figure 1. Flash memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 2. IAP flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 3. COM port settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 4. IAP driver menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 5. IAP driver menu when the Flash memory is write-protected . . . . . . . . . . . . . . . . . . . . . . . 11
剩余15页未读,继续阅读














μLink
- 粉丝: 11
- 资源: 3
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- Kylin-Server-V10-SP3-General-Release-2212-X86-64.7z.006
- 龙芯LoongArch架构寄存器名称及所有指令名称
- NMOS充电泵分立电路SABER仿真
- yolov5l_10per_ssod_defect_exp1.yaml
- termux-app_v0.118.0+github-debug_armeabi-v7a.apk
- 01-硬件设计-VPX高速连接器介绍_水果里面有苹果的博客-CSDN博客 (2023_12_7 19_14_47).html
- 河南省2019网络搭建与应用赛项赛题环境
- 电磁阀恒流驱动SABER仿真
- 河南省2019网络搭建与应用赛项赛题技能要求
- 4.1 不定积分的概念与性质.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论5