2021-07-20 08:42 AM
Hello all,
I am flashing some STF091 chips with STM32CubeProgrammer and discovered "Automatic Mode" which looks perfect for flashing many chips in a small amount of time.
After I flash a chip, I am setting the option bytes so that the chip will boot into main flash (which it does). However, after it boots into main flash, STM32CubeProgrammer attempts to reestablish connection with the chip and times out due to the bootloader not having control.
Even though it eventually prompts me to connect a new chip, the only way to get Cube Programmer to recognize it is relaunching the application (which defeats the automatic part).
Is there any way to flash chip -> boot to main flash -> connect new chip -> repeat?
11:38:53 : Starting Automatic Mode...
11:38:53 : Waiting for device n:1...
11:38:55 : Memory Programming ...
11:38:55 : Opening and parsing file: Tri Sensor Firmware.bin
11:38:55 : File : Tri Sensor Firmware.bin
11:38:55 : Size : 76188 Bytes
11:38:55 : Address : 0x08000000
11:38:55 : Erasing memory corresponding to segment 0:
11:38:55 : Erasing internal memory sectors [0 37]
11:38:55 : Download in Progress:
11:39:19 : File download complete
11:39:19 : Time elapsed during download operation: 00:00:24.722
11:39:19 : PROGRAMMING OPTION BYTES AREA ...
11:39:19 : Warning: Option Byte: BOOT_SEL, value: 0x0, was not modified.
11:39:19 : Warning: Option Byte: nBOOT1, value: 0x1, was not modified.
11:39:19 : Bank : 0x00
11:39:19 : Address : 0x1ffff800
11:39:19 : Size : 16 Bytes
11:39:19 : Reconnection after Option Bytes Programming
11:39:23 : Timeout error occured while waiting for acknowledgement.
11:39:24 : Timeout error occured while waiting for acknowledgement.
11:39:26 : Timeout error occured while waiting for acknowledgement.
11:39:26 : Timeout error occured while waiting for acknowledgement.
11:39:28 : Timeout error occured while waiting for acknowledgement.
11:39:28 : Timeout error occured while waiting for acknowledgement.
11:39:30 : Timeout error occured while waiting for acknowledgement.
11:39:30 : Timeout error occured while waiting for acknowledgement.
11:39:32 : Timeout error occured while waiting for acknowledgement.
11:39:32 : Timeout error occured while waiting for acknowledgement.
11:39:34 : Timeout error occured while waiting for acknowledgement.
11:39:34 : Timeout error occured while waiting for acknowledgement.
11:39:34 : Downloading Option Bytes Data failed
11:39:34 : UPLOADING OPTION BYTES DATA ...
11:39:34 : Bank : 0x00
11:39:34 : Address : 0x1ffff800
11:39:34 : Size : 16 Bytes
11:40:04 : Timeout error occured while waiting for acknowledgement.
11:40:04 : READ command not acknowledged at address: 0x1FFFF800
11:40:04 : Uploading Option Bytes bank: 0 failed
11:40:05 : Please disconnect device n:1 and connect the next...
Thanks
2021-07-20 08:50 AM
Is NRST connected?
Anything else putting the debug pins (PA13,PA14) into alternate states, disabling SWD connectivity, or going into a low power mode?
Is your code running? Can it provide signs-of-life via an LED, GPIO or UART in this condition?
Could the application firmware check, and set the appropriate option bytes itself?
Some options, on some STM32, require a power cycle, not a reset
2021-07-20 08:59 AM
Sorry, I should have been more specific. I am using the UART bootloader to flash the chips with STCubeProgrammer.
I successfully flash and set the option bytes to boot into main flash, and the program indeed executes. CubeProgrammer however tries to start reading from the chip afterwards and starts timing out (since the bootloader is no longer in control on the chip). After this you need to restart CubeProgrammer to connect to a new chip.
Perhaps this is just a limitation of CubeProgrammer.
2021-07-20 09:19 AM
Consider using the command line version if you're just programming a bunch of chips.
2021-07-20 09:22 AM
I think thats what I'm leaning towards too now. This was eventually going to be used down the line in production so I was hoping the GUI version had the capability :(