stm32程序跑飞的原因_STM32F030擦除FLASH时程序跑飞

王蓓芹

2020-04-07

感觉你这个问题是系统架构问题哦,你要知道,MCU在擦除FLASH的过程中是不同同时取指的,原文如下:An ongoing Flash memory operation will not block the CPU as long as the CPU does notaccess the Flash memory.On the contrary, during a program/erase operation to the Flash memory, any attempt to readthe Flash memory will stall the bus. The read operation will proceed correctly once theprogram/erase operation has completed. This means that code or data fetches cannot bemade while a program/erase operation is ongoing.For program and erase operations on the Flash memory (write/erase), the internal RCoscillator (HSI) must be ON.看出啥意思了吗?在你擦除FLASH的过程中代码是没有办法执行的,因为AHB总线已经被FLASH操作占据了,当然也就没法喂狗了,中断也不能响应,这样一来IWDG复位就很正常了。建议:擦除时一个扇区一个扇区的来,中间间隔喂狗,调整好喂狗时间间隔,算好时间,数据手册有擦除一个扇区所需要的时间参数,自己计算好吧。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值