0

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

ST 的文档(AN2606 和 AN3155)指出这应该是可能的,但我没有尝试过任何工作。我试过 ST 的 GUI demo flasher。我还尝试通过 ST 的命令行客户端批量擦除设备并禁用读出保护。

我能想到的唯一一件事是我正在跳入引导加载程序,而不是使用引导引脚来启动引导加载程序。然而,即使这似乎是 ST 考虑的问题,因为他们声明他们会定期刷新看门狗 (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 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 -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, dataready = 1, 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, baudrate = 115200, data-bit = 8, stop-bit = 1.0, 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, dataready = 0, 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 的社区网站上发布了这个

4

0 回答 0