How to Write Firmware and Start It Automatically by Using STM32_Programmer_CLI ? (USB DFU)
Hi,
I'm using STM32WB55 mcu. (USB DFU)
I write a simple program which runs STM32_Programmer_CLI multiple times with these arguments and than checking return code & CLI output If every step completed successfully.
1) Clearing nBoot0 and nSWBOOT0 bytes.
"-c port=usb sn=serialNumber -ob nBoot0=0x00 nSWBOOT0=0x00 -ob displ"
2) If user requested FUS and BLE stack update :
"-c port=usb sn=serialNumber -fwdelete" and than
"-c port=usb sn=serialNumber -r32 0x20030030 1" to read FUS version.
"-c port=usb sn=serialNumber -fwupgrade PathToFile 0x080EC000 firstinstall=0" to update FUS
"-c port=usb sn=serialNumber -fwupgrade PathToFile 0x080CE000 firstinstall=0" to update BLE stack.
3) Write my firmware.
"-c port=usb sn=serialNumber -w fwPath 0x08000000";
4) Set nBoot0 and nSWBOOT0 bytes.
"-c port=usb sn=serialNumber -ob nBoot0=0x01 nSWBOOT0=0x01 -ob displ",
I want my firmware start automatically after all these steps.
If I do it this way, sometimes it works and sometimes it doesn't. I'm probably doing something wrong. What is the correct way to do this?
Thanks.
