我可以使用具有1级闪存读取保护功能的STM32F303RDTx的ROM引导加载程序吗?

问题描述

ST在STM32F303RDTx中提供了ROM引导加载程序。我可以从应用程序跳入引导加载程序,并在禁用读取保护(RDP)(级别0)时更新闪存。当RDP设置为1级时,所有禁用RDP的尝试都会失败(这会大量擦除闪存)。到目前为止,我尝试过的所有操作似乎都会触发设备重置,从而使我回到应用程序中。

ST的文档(AN2606和AN3155)指出,这应该可行,但我尝试过的任何方法都没有。我已经尝试过ST的GUI演示闪光器。我还尝试过大规模擦除设备并通过ST的命令行客户端禁用读取保护。

我唯一能想到的是我跳进了引导加载程序,而不是使用引导引脚为引导加载程序加电。但是,即使这似乎也是ST负责的,因为他们指出,如果通过调用代码启用了看门狗(IWD),他们会定期刷新看门狗(IWD)。

尝试禁用读出保护:

C:\Program Files (x86)\STMicroelectronics\Software\Flash Loader Demo>STMFlashLoader.exe -c --pn 6 --br 115200 --db 8 --pr EVEN -i STM32F3_03_02_512K -p --drp
opening Port                             [OK]
Activating device                                [KO]
Unrecognized device... Please,reset your device then try again
Please,reset your device then press any key to continue

 Press any key to continue ...

尝试大规模擦除:

C:\Program Files (x86)\STMicroelectronics\Software\Flash Loader Demo>STMFlashLoader.exe -c --pn 6 --br 115200 --db 8 --pr EVEN -i STM32F3_03_02_512K -e --all
opening Port                             [OK]
Activating device                                [KO]
Unrecognized device... Please,reset your device then press any key to continue

 Press any key to continue ...

在未启用读取保护的情况下,上述命令可以正确执行。

尝试禁用读出保护(如果已禁用):

C:\Program Files (x86)\STMicroelectronics\Software\Flash Loader Demo>STMFlashLoader.exe -c --pn 6 --br 115200 --db 8 --pr EVEN -i STM32F3_03_02_512K -p --drp
opening Port                             [OK]
Activating device                                [OK]
disabling read protection                                [OK]
reseting device                                  [KO]

评论中所建议,我尝试了STMCubeProgrammer,将详细程度设置为3(最大值)。这是我得到的错误

10:27:43:749 : Serial Port COM6 is successfully opened.
10:27:43:749 : Port configuration: parity = even,baudrate = 115200,data-bit = 8,stop-bit = 1.0,flow-control = off
10:27:43:750 : No Init bits value is : 0
10:27:43:750 : Sending init command:
10:27:43:750 : byte 0x7F sent successfully to target
10:27:43:765 : Wait ends after 1 loop,dataready = 1,delay = 18
10:27:43:765 : Received response from target: 0x43
10:27:43:766 : byte 0x7F sent successfully to target
10:27:43:782 : Wait ends after 1 loop,delay = 16
10:27:43:783 : Received response from target: 0x6f
10:27:43:783 : Error: Activating device: KO. Please,verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
10:27:43:979 : disconnected from device.
10:27:44:018 : Serial Port COM6 is successfully opened.
10:27:44:018 : Port configuration: parity = even,flow-control = off
10:27:44:018 : No Init bits value is : 0
10:27:44:019 : Sending init command:
10:27:44:019 : byte 0x7F sent successfully to target
10:27:45:019 : Wait ends after 1 loop,dataready = 0,delay = 1001
10:27:45:019 : Timeout error occured while waiting for ackNowledgement.
10:27:45:020 : No response from target received
10:27:45:020 : byte 0x7F sent successfully to target
10:27:45:120 : Wait ends after 1 loop,delay = 101
10:27:45:120 : Timeout error occured while waiting for ackNowledgement.
10:27:45:121 : No response from target received
10:27:45:121 : Error: Activating device: KO. Please,verify the boot mode configuration and check the serial port configuration. Reset your device then try again...

我还将此内容发布在ST的社区网站here上。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)