gpt4 book ai didi

stm32 - 无需任何操作即可启用读出保护,并且无法禁用

转载 作者:行者123 更新时间:2023-12-02 03:53:58 25 4
gpt4 key购买 nike

我目前正在开发基于 STM32F4 的独立开发板 (STM32F469)。到目前为止,一切正常。我通过 ST-Link Utility 通过 SWD 使用 STM32F4-DISCOVERY ST-Link 对我的微 Controller 进行编程。

星期五,当我下类时,一切都运转良好。今天早上当我回到办公室时,我的程序并没有在黑板上启动。当我尝试通过 SWD 连接到 STM32F4 时,STM32 ST-Link Utility 显示一条警告消息:

Can not read memory! Disable Read Out Protection and retry

虽然我没有设置任何东西。我做了一些研究并尝试了一些事情:

  • 更改Target > Option Bytes > Read Out Protection 中的选项字节。我不知道它是否与实际 RDP 状态相关,但当我打开此选项卡时,RDP 处于1 级。当我将它设置为 0 并单击应用时,几秒钟后显示一条错误消息,提示无法设置选项字节!请重置目标并重试。
  • 我试图删除芯片。当然,由于设置了 RDP,它没有用。
  • 我已经更新了 ST-Link 固件。我没有更新 STM32 ST-Link 实用程序,因为到目前为止运行良好 (v4.0.0.0)。我没有改变任何东西。
  • 我尝试连接到处于重置状态的芯片。 听起来不错,但行不通

我不知道还能做什么。当我阅读我的 STM32F4 (RM0386) 的引用手册时,第 87 页我们可以阅读:

Level 1: read protection enabled.

It is the default read protection level after option byte erase. The read protection Level 1 is activated by writing any value (except for 0xAA and 0xCC used to set Level 0 and Level 2, respectively) into the RDP option byte. When the read protection Level 1 is set:

  • No access (read, erase, program) to Flash memory or backup SRAM can be performed while the debug feature is connected or while booting from RAM or system memory bootloader. A bus error is generated in case of read request.
  • When booting from Flash memory, accesses (read, erase, program) to Flash memory and backup SRAM from user code are allowed.

When Level 1 is active, programming the protection option byte (RDP) to Level 0 causes the Flash memory and the backup SRAM to be mass-erased. As a result the user code area is cleared before the read protection is removed. The mass erase only erases the user code area. The other option bytes including write protections remain unchanged from before the mass-erase operation. The OTP area is not affected by mass erase and remains unchanged. Mass erase is performed only when Level 1 is active and Level 0 requested. When the protection level is increased (0->1, 1->2, 0->2) there is no mass erase.

首先,RDP 是否有可能被某种超自然现象激活了?我发誓我没有设置这个位。另外,正如我所阅读的1 级 描述,返回到 0 级是可能的(但用户程序已被删除)。对我来说,从 Level 1 到 Level 0 是行不通的。所以....我担心 RDP 级别实际上是 2,在这种情况下......我死定了。

有没有办法解决这个问题?我不明白周末期间会发生什么变化,因为一切都运行良好,但现在一切都不正常了。

提前致谢。

最佳答案

当我在删除闪存(0xff ...)的同时使用选项字节时,随机设置了 r/w 保护。

尝试这样做:

  1. 断开芯片的所有连接并重置电源。
  2. 打开 ST-Link Utility 并转到 Target > Option Bytes。
  3. 取消选中 PCROP_RDP(先不要点击“应用”!)。
  4. 将读出保护更改为 0(顶部的下拉菜单)。
  5. 现在才点击“应用”。

您会看到芯片被删除,并且在“读/写保护”选项卡上的“选项字节”屏幕中,您会看到以前 protected 相应存储区现在自动取消选中。

关于stm32 - 无需任何操作即可启用读出保护,并且无法禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44626010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com