当前位置:网站首页>STM8S003F3 内部flash调试
STM8S003F3 内部flash调试
2022-07-25 18:00:00 【smile_5me】
这里做个记录,方便以后可以使用
查看文档手册,data eeprom的起始地址为0x004000,这个是用于存放一些例如版本号,ID,或者是标志位的这个来使用

示例代码:
typedef enum {
FLASH_MEMTYPE_PROG = (u8)0x00, /*!< Program memory */
FLASH_MEMTYPE_DATA = (u8)0x01 /*!< Data EEPROM memory */
} FLASH_MemType_TypeDef;
int main()
{
u32 addr = 0x4000;
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
while(1)
{
FLASH_Unlock(FLASH_MEMTYPE_DATA); //根据MemType填写
FLASH_EraseByte(addr);
FLASH_ProgramByte(addr, 0xa5);
if(FLASH_ReadByte(addr) == 0xa5)
{
;
}
FLASH_Lock(FLASH_MEMTYPE_DATA);
delay_ms(500);
}
}
参考博客:https://blog.csdn.net/zhangxuechao_/article/details/77749823
边栏推荐
猜你喜欢

Hcip first day experiment

Sorting also needs to know the information and linked list

WPF 实现用户头像选择器

OSPF --- open shortest priority path protocol

绘制pdf表格 (一) 通过itext实现在pdf中绘制excel表格样式并且实现下载(支持中文字体)

Cloud VR: the next step of virtual reality specialization

OSPF---开放式最短优先路径协议

喜讯!瑞云科技被授予“海上扬帆”5G融合应用专委会成员单位

11. Camera and lens

Idea integrates common functions of SVN code management
随机推荐
关于flickr的数据集笔记
Why the future of digitalization depends on 3D real-time rendering
C# Linq 去重&去重求和
Mock服务moco系列(二)- Json格式、File文件、Header、Cookie、解决中文乱码
Good news! Ruiyun technology was awarded the member unit of 5g integrated application special committee of "sailing on the sea"
go defer与recover简单笔记
期货开户哪家最好最安全
Hit the test site directly: summary of common agile knowledge points in PMP examination
Brief introduction of bubble sort and quick sort
Brief introduction to clustered index, secondary index, index push down
Memory and packet buffer management of LwIP
3DCAT v2.1.3新版本发布,这三大功能更新你不容错过!
更新|3DCAT实时云渲染 v2.1.2版本全新发布
WPF implements user avatar selector
new与malloc
Resttemplate realizes the unified encapsulation (printable log) of post, put, delete, get, set request and file upload (batch files and parameters) through generics
大话DevOps监控,团队如何选择监控工具?
简述冒泡排序与快速排序
Ch582 ble 5.0 uses Le coded broadcast and connection
Several implementations of PHP to solve concurrency problems