Unable to flash new firmware on STM32L031C6
I have been flashing ST with the Flash Loader Demo utility successfully for long time, directly to my PCB design. BOOT0 pin is high, everything around the STM32 is quite (no activity on peripherals connected). Reset properly connected to a Resistor with a small Cap.
I try with a second PCB board and got the same issue.
Googled the issue, read the Q&A, Try the CubeProgrammer, try the FlashLoader demo and try bootloader commands using a serial terminal. All tests with some interaction but unable to flash a new firmware.
Flash Loader demo: It connects, shows "Target is readable. Please click Next to proceed. "remove protection" button is disabled. Next screen No target list, PID 0x45 (correct) BID: NA and version 3.1. Can't do anything more here. Flash Loader is not useful anymore after this point.
Manual bootloader codes: Sent the 0x7F and received the ACK, Sent the 0x00 0xFF, received the proper answer (1F 79 0B 31 00 01 02 11 21 31 44 63 73 82 92 79) , Just in case sent the readout unprotect command 0x92 0x6D, received correctly the 79 79. So it looks ok.
STM32CubeProgrammer: after click the button Coonect, looks like is connected, but the top bar red label shows "Not connected" here is the Verbose level 2 detail:
13:21:07:470 : Serial Port COM25 is successfully opened.
13:21:07:472 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off
13:21:07:473 : No Init bits value is : 0
13:21:07:473 : Sending init command:
13:21:07:473 : byte 0x7F sent successfully to target
13:21:07:487 : Wait ends after 1 loop, dataready = 1, delay = 16
13:21:07:487 : Received response from target: 0x79
13:21:07:500 : Activating device: OK
13:21:07:500 : Sending GetID command and its XOR:
13:21:07:500 : byte 0x02 sent successfully to target
13:21:07:501 : byte 0xFD sent successfully to target
13:21:07:508 : Wait ends after 1 loop, dataready = 1, delay = 6
13:21:07:508 : Received response from target: 0x79
13:21:07:508 : Received response from target: 0x01042579
13:21:07:508 : Chip ID: 0x425
13:21:07:508 : Sending Get command and its XOR:
13:21:07:509 : byte 0x00 sent successfully to target
13:21:07:517 : byte 0xFF sent successfully to target
13:21:07:533 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:07:533 : Received response from target: 0x79
13:21:07:533 : Received response from target: 0x0b
13:21:07:534 : size of bytes in the response: 11
13:21:07:534 : Received response from target: 0x31000102112131446373829279
13:21:07:534 : Full received response: 0b31000102112131446373829279
13:21:07:534 : BootLoader protocol version: 3.1
13:21:07:536 : byte 0x11 sent successfully to target
13:21:07:536 : byte 0xEE sent successfully to target
13:21:07:556 : data sent successfully to target: 0x0800000008
13:21:07:564 : byte 0x00 sent successfully to target
13:21:07:564 : byte 0xFF sent successfully to target
13:21:07:575 : Sending GetID command and its XOR:
13:21:07:577 : byte 0x02 sent successfully to target
13:21:07:577 : byte 0xFD sent successfully to target
13:21:07:589 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:07:590 : Received response from target: 0x79
13:21:07:590 : Received response from target: 0x01042579
13:21:07:726 : byte 0x11 sent successfully to target
13:21:07:730 : byte 0xEE sent successfully to target
13:21:07:730 : data sent successfully to target: 0x0800000008
13:21:07:743 : byte 0x00 sent successfully to target
13:21:07:754 : byte 0xFF sent successfully to target
13:21:07:759 : Sending Read command and its XOR:
13:21:07:766 : byte 0x11 sent successfully to target
13:21:07:767 : byte 0xEE sent successfully to target
13:21:07:780 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:07:783 : Received response from target: 0x79
13:21:07:783 : Sending Read address and its checksum:
13:21:07:784 : data sent successfully to target: 0x1ff80000e7
13:21:07:804 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:07:804 : Received response from target: 0x79
13:21:07:806 : Sending number of bytes to be read - 1 and its checksum:
13:21:07:806 : data sent successfully to target: 0x03fc
13:21:07:826 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:07:826 : Received response from target: 0x79
13:21:07:827 : Received response from target: 0xaa0055ff
13:21:07:829 : Database: Config 0 is active.
13:21:07:829 : byte 0x11 sent successfully to target
13:21:07:829 : byte 0xEE sent successfully to target
13:21:07:829 : data sent successfully to target: 0x0800000008
13:21:07:868 : byte 0x00 sent successfully to target
13:21:07:869 : byte 0xFF sent successfully to target
13:21:09:253 : byte 0x11 sent successfully to target
13:21:09:253 : bytesToWrite before send = 1
13:21:09:253 : bFlushRet = 1, bytesToWrite after flush() = 1
13:21:09:253 : waitForBytesWritten Error : The wait operation timed out.
13:21:09:253 : byte 0xEE sent successfully to target
13:21:09:254 : data sent successfully to target: 0x0800000008
13:21:09:254 : byte 0x00 sent successfully to target
13:21:09:254 : byte 0xFF sent successfully to target
13:21:09:255 : UPLOADING OPTION BYTES DATA ...
13:21:09:255 : Bank : 0x00
13:21:09:255 : Address : 0x1ff80000
13:21:09:255 : Size : 20 Bytes
13:21:09:256 : Sending Read command and its XOR:
13:21:09:257 : byte 0x11 sent successfully to target
13:21:09:257 : byte 0xEE sent successfully to target
13:21:09:257 : Wait ends after 1 loop, dataready = 1, delay = 13
13:21:09:257 : Received response from target: 0x79
13:21:09:258 : Sending Read address and its checksum:
13:21:09:258 : data sent successfully to target: 0x1ff80000e7
13:21:09:258 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:09:259 : Received response from target: 0x79
13:21:09:259 : Sending number of bytes to be read - 1 and its checksum:
13:21:09:259 : data sent successfully to target: 0x13ec
13:21:09:259 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:09:259 : Received response from target: 0x79
13:21:09:260 : Received response from target: 0xaa0055ff70808f7f0000ffff0000ffff00000000
13:21:09:260 : UPLOADING OPTION BYTES DATA ...
13:21:09:261 : Bank : 0x00
13:21:09:261 : Address : 0x1ff80000
13:21:09:261 : Size : 20 Bytes
13:21:09:261 : Sending Read command and its XOR:
13:21:09:262 : byte 0x11 sent successfully to target
13:21:09:262 : byte 0xEE sent successfully to target
13:21:09:262 : Wait ends after 1 loop, dataready = 1, delay = 12
13:21:09:262 : Received response from target: 0x79
13:21:09:263 : Sending Read address and its checksum:
13:21:09:263 : data sent successfully to target: 0x1ff80000e7
13:21:09:263 : Wait ends after 1 loop, dataready = 1, delay = 15
13:21:09:263 : Received response from target: 0x79
13:21:09:264 : Sending number of bytes to be read - 1 and its checksum:
13:21:09:264 : data sent successfully to target: 0x13ec
13:21:09:264 : Wait ends after 1 loop, dataready = 1, delay = 16
13:21:09:264 : Received response from target: 0x79
13:21:09:264 : Received response from target: 0xaa0055ff70808f7f0000ffff0000ffff00000000I can not erase the flash or flash a new firmware, or check the option bytes. (no activity, no messages)
CubeProgrammer didn't show the Flash size, and never show "connected".
I'm empty of options now, any help will be really appreciated.
Thanks in advance.
