2022-12-30 05:37 PM
We have seen several signatures of this issue.
Signature 1:
The extracted binary shows that the image is located on Bank1. Also the extracted byte options show that the image should be located on Bank2 but it was empty and still the device boots up after hard power cycle(removed battery and put back)and work fine.
Signature 2:
When we took the same above image and flash it on to the new device, where code is in bank 1 but we set option byte swap bank to bank 2. The device consistently is in dfu mode and does not boot up like the above device after hard power cycle.
How do we explain the above behavior. Is there anything else than the nbank swap option byte which control boot process?
Apart from dfu and initial flashing using st link. Is there any other process which can change the nswap bank option byte?
Also is there any difference between mcu boot via watchdog timer and hard reset like removing battery?
Any insights.
Thank you,
Krishna
2022-12-31 12:41 AM
Hi Krishna, somethink in your programming sequence is bad.
And yes any reset (sw or hw) differ from power off. Some mcu setup registers is changed only on power off.
2022-12-31 11:50 AM
Hi MM..1,
When you mean programming sequence is bad. Below is the command we execute in factory
STM32_Programmer_CLI.exe -c port=SWD freq=1800 sn=52FF6D065271495015371887 -e all -w D:\diag\build.bin 0x08000000]
We do not program any option bytes. We leave them to be default as it is with what comes from MCU vendor.
Is there any logic inside the stm bootloader even though we set the nbank swap bit to bank 2, but if there is no image in bank 2 to default it back to bank 1 ? Or any other logic which explains the above behaviour.
Thanks,
krishna
2023-01-01 01:42 AM
Try instead -w use -d your.elf -v
sn is required only for multiple connected stlinks.