当前位置:网站首页>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
边栏推荐
- 大话DevOps监控,团队如何选择监控工具?
- itextpdf实现多PDF文件合并为一个PDF文档
- Who is responsible for the problems of virtual idol endorsement products?
- Postman快速上手
- How to choose digital twin visualization platform
- 简述聚簇索引、二级索引、索引下推
- Mongodb cluster and sharding
- 食品安全 | 八问八答带你重新认识小龙虾!这样吃才对!
- HCIP第一天实验
- Step by step introduction of sqlsugar based development framework (13) -- package the upload component based on elementplus, which is convenient for the project
猜你喜欢

如何选择数字孪生可视化平台

排序还需要了解的信息以及链表

Redis source code and design analysis -- 16. AOF persistence mechanism

Thesis reading_ Multi task learning_ MMoE

Cloud VR: the next step of virtual reality specialization

OSPF综合实验

Take you to a preliminary understanding of multiparty secure computing (MPC)

「数字安全」警惕 NFT的七大骗局

"Digital security" alert NFT's seven Scams

Cet
随机推荐
CVE-2022-33891 Apache spark shell 命令注入漏洞复现
Postman快速上手
Thesis reading_ Multi task learning_ MMoE
什么是 IP SSL 证书,如何申请?
Take you to a preliminary understanding of multiparty secure computing (MPC)
OSPF --- open shortest priority path protocol
I2C communication - sequence diagram
Landmark buildings around the world
"Deprecated gradle features were used in this build, making it incompatible with gradle 6.0" problem solving
mysql case when
带你初步了解多方安全计算(MPC)
Cet
RedisTemplate解决高并发下秒杀系统库存超卖方案 — Redis事务+乐观锁机制
Unity 贝塞尔曲线的创建
Principle and implementation of UDP penetration NAT in P2P
Why the future of digitalization depends on 3D real-time rendering
SDLC 软件开发生命周期及模型
Several implementations of PHP to solve concurrency problems
How many points did NPDP pass? How to pass with high scores?
itextpdf实现多PDF文件合并为一个PDF文档