MDK程序下载 程序下载----FLM⽂件 ⽂件 MDK编程算法 编程算法 ⽤过MDK下载程序的⼩伙伴可能都知道,在下载程序之前需要都在Debug设置的Flash Download⼦选项卡选择编程算法。⼤多数时 候, 我们只要安装了芯⽚包之后,就可以直接得到对应的编程算法,并不需要我们去修改它。但是,当你是⼀个芯⽚包的开发者,或者你有独特 的下载需求(⽐如在你的程序⾥加⼊⼀些校验信息),这个时候你就需要去了解它了! 编程算法呢,说⽩就其实也就是⼀段程序,主要功能就是擦除相应的内存块,并将我们的程序写⼊到相应的内存区域上去。 在你点击下载按钮的时候,这段程序会被先下载到RAM上(RAM for Algorithm上的设置),然后才会通过它,将你的程序写⼊到 指定的内存区域内。 实现⼀个⾃⼰的编程算法 实现⼀个⾃⼰的编程算法 怎么去实现⼀个⾃⼰的编程算法?⾸先我们找到⾃⼰的MDK的安装路径,进⼊到ARM\Flash⽂件夹下(例如: D:\Keil_v5\ARM\Flash)。 这⾥有个编程算法的⼯程模板,复制这个⼯程到你的⼯程⽂件夹下,重命名你⾃⼰的想要的名字。 打开⼯程,⾥⾯主要有两个⽂件 FlashPrg.c 和 FlashDev.c: FlashDev.c主要实现了⼀个设备相关的结构体(根据⾃⼰的Flash情况去实现) ⽐如STM32L051实现如下: FlashPrg.c实现了⼏个Flash编程相关的函数: 根据⾃⼰的需要去实现,STM32L051实现如下: 1 /* ----------------------------------------------------------------------------- 2 * Copyright (c) 2014 ARM Ltd. 3 * 4 * This software is provided 'as-is', without any express or implied warranty. 5 * In no event will the authors be held liable for any damages arising from 6 * the use of this software. Permission is granted to anyone to use this 7 * software for any purpose, including commercial applications, and to alter 8 * it and redistribute it freely, subject to the following restrictions: 9 * 10 * 1. The origin of this software must not be misrepresented; you must not 11 * claim that you wrote the original software. If you use this software in 12 * a product, an acknowledgment in the product documentation would be 13 * appreciated but is not required. 14 * 15 * 2. Altered source versions must be plainly marked as such, and must not be 16 * misrepresented as being the original software. 17 * 18 * 3. This notice may not be removed or altered from any source distribution. 19 * 20 * 21 * $Date: 18. November 2014 22 * $Revision: V1.00 23 * 24 * Project: Flash Programming Functions for ST STM32L0xx Flash 25 * --------------------------------------------------------------------------- */ 26 27 /* History: 28 * Version 1.00 29 * Initial release 30 */ 31 32 #include "FlashOS.H" // FlashOS Structures 33 34 typedef volat
- 粉丝: 167
- 资源: 3万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx