Problem with bootloader flash erase/read.
I am trying to program the FLASH via the bootloader on USART1 of an STM32L431RBT6.
I can successfully access the bootloader with boot0=1 and a reset.
The bootloader properly acknowledges all the following commands, and returns the correct information:
0x7F
0x00 (Get)
0x01 (Ger version)
0x02 (Get ID)
0x63 (write protect)
0x73 (write unprotect)
0x82 (readout protect)
0x92 (readout unprotect)
However, when I try and read or erase the flash the processor seems to reset internally (NRST goes low).
An example of this is the following sequence:
Send: 0x7F (connect)
Receive: 0x79 (ACK)
Send: 0x73 0x8C (write unprotect)
Receive : 0x79 (ACK)
Send: 0x44 0xBB (extended erase)
Receive : 0x79 (ACK)
Send: 0xFF 0xFF 0x00 (Mass erase)
Receive: (No response and processor resets)
The problem is the same if I try and do a bank 1 erase (0xFFFE) or bank 2 erase (0xFFFD) etc…
I will note as well that if I don’t do the “write unprotect�? command prior to the flash erase, then the processor does respond with NAK i.e.
Send: 0x7F (connect)
Receive: 0x79 (ACK)
Send: 0x44 0xBB (extended erase)
Receive : 0x79 (ACK)
Send: 0xFF 0xFF 0x00 (Mass erase)
Receive: 0x1F (NACK) (no reset)
I am not sure what is going on or what I am doing wrong. These resets don’t appear to originate from any external source and are an internal reset of the processor.
Any advice? Thanks!
Some more info:
Bootloader: 3.1
Processor ID: 4.35 (53d)
options:

