AnsweredAssumed Answered

USART System Bootloader - Process and Protection Removal

Question asked by Phil V on Sep 7, 2012
Latest reply on Sep 14, 2012 by Phil V

I am trying to reprogram an STM32F407IG by using the USART interface as described in THIS DOCUMENT (AN3155).

I am able to establish comms to the device, and read the PID, but as soon as I try to remove the READ (or WRITE) protection, I lose comms to the device.

This is my process as it stands:

- Place device into reset and take BOOT0 high, then release from Reset
- Establish Comms
    Send 0x7F and wait for 0x79 response.
- Read PID to confirm correct device
    Send 0x02 0xFD and await for response.
- Remove Readout Protection
    Send 0x92 0x6D and wait for response (0x79 0x79)
- Read PID to confirm comms
    Send 0x02 0xFD and await for response.

The final Reading of the PD always fails, and I'm not sure why.
In AN3155 it states the following with regards to the Readout Protection command (and any others that affect the option bytes):

At the end of the Readout Unprotect command, the bootloader transmits an ACK and generates a system Reset to take into account the new configuration of the option byte.

This seems to indicate that after the final ACK (0x79) from the device, it will perform a system reset, however even allowing for this I am unable to regain comms.
I have tried repeating the 'Establish Comms' routine (send 0x7F and wait for 0x79) incase the system reset means that the Bootloader needs to re-sync the comms, but that doesn't seem to work.

Am I missing something here?
How 'deep' does the 'System Reset' mentioned in the documentation go; 
  Does it just cause the bootloader to re-read the option bytes?
  Do I need to be re-establishing comms again (with the 0x7F / 0x79 routine) after running it?
  Should I be (externally) driving and releasing the 'Reset' line to the device after sending the command?

Many thanks for any help or guidance that can be offered!