Then I decided that I wanted to use a smaller bootloader, so I used the same USB-TTL interface and stm32flash to install the 2K HID bootloader, again using the Boot0 method. with a command line:
Code: Select all
stm32flash.exe -g 0x8000000 -b 115200 -w hid_generic_pc13.bin COM4
The board quit working (blinking) and was unresponsive to Boot0 protocol on USART1. I got an ST-Link V2 and found that the board would not connect in either "normal" nor "connect under reset" modes. I did get it to connect in "hot plug" mode, and found that read-out protection was enabled in apparently irreversible way. I could not reset the read-out protection (or flash write protection) using the "Option Byte" dialog of the ST-Link utility. So the board/MCU looks bricked.
What did I do wrong? I figure the possibilities are:
1) Infant mortality - the BP gave up the ghost, and what did I expect for two bucks?
2) Somehow, I flashed over the option byte area in a bad way, and caused this. This seems unlikely, because if I'm reading the relevant app note (PM0075) correctly, one needs to write a special "key sequence" to a given address to lock up the flash / option bytes.
3) Something else?
Please let me know if you see anything suspect in what I did. I've got a few more BPs on order and would rather not kill them similarly.
Also, am I missing a way to unlock the MCU with ST-Link?
BTW, the STMicro "feature" of allowing a programmer to permanently brick a chip as a method of preventing someone from reading out proprietary code seems like a callous ploy to sell more chips. You should always be able to restore a chip to a "fab fresh" state by doing a full-chip erase, IMO.
Thanks in advance,