2023-01-06 17:10:33 -08:00
# Proteus F767 Programming Instructions
2021-10-07 21:59:24 -07:00
Too many of Proteus 0.6 with F767 are behaving strangely in terms of SWD programming. Maybe we have a hardware design issue? Maybe we are missing something?
2021-10-07 21:51:02 -07:00
2023-01-02 11:22:23 -08:00
Anyway looks like there is a working procedure, using DFU and STM32CubeProgrammer
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
## Command line option
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
1. use STM32CubeProgrammer software [STM32CubeProgrammer ](https://www.st.com/en/development-tools/stm32cubeprog.html )
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
2. connect via USB while holding PROG button
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
3. make sure you have "STM32 BOOTLOADER" driver not "STM Device in DFU Mode". If necessary update/install driver from C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\Drivers\DFU_Driver
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
4. Enter cmd.exe, enter C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin folder
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
```shell
STM32_Programmer_CLI.exe -c port=usb1 -ob nDBANK=0
```
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
5. from same command line prompt
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
```shell
STM32_Programmer_CLI.exe -c port=usb1 -e all
```
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
6. download [Proteus F7 Firmware bundle 2021.10.08 ](https://github.com/rusefi/rusefi/releases/download/2021.10.08_release/rusefi_bundle_proteus_f7.zip ) and un-compress and copy rusefi.hex to C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin folder
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
7. from same command line prompt
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
```shell
STM32_Programmer_CLI.exe -c port=usb1 -w rusefi.hex -v -s
```
2021-10-11 13:50:21 -07:00
Done!
2023-01-06 17:10:33 -08:00
## GUI option
2021-10-11 13:50:21 -07:00
2023-01-06 17:10:33 -08:00
1. use STM32CubeProgrammer software [STM32CubeProgrammer ](https://www.st.com/en/development-tools/stm32cubeprog.html )
2021-10-07 21:51:02 -07:00
2023-01-06 17:10:33 -08:00
2. connect via USB while holding PROG button
2021-10-07 21:51:02 -07:00
2023-01-06 17:10:33 -08:00
3. make sure you have "STM32 BOOTLOADER" driver not "STM Device in DFU Mode". If necessary update/install driver from C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\Drivers\DFU_Driver
2021-10-07 21:51:02 -07:00
2023-01-06 17:10:33 -08:00
4. connect STM32CubeProgrammer via USB, follow [this guide ](HOWTO-nDBANK ) to reset nDBANK flag
2021-10-07 21:51:02 -07:00
2023-01-06 17:10:33 -08:00
5. close STM32CubeProgrammer, unplug USB cable, plug USB cable, open STM32CubeProgrammer. STM32CubeProgrammer is finicky you really have to restart it between steps
2021-10-07 21:51:02 -07:00
2023-01-06 17:10:33 -08:00
6. erase using "Full Chip Erase"
2021-10-07 21:55:33 -07:00
2023-01-06 17:10:33 -08:00
![x ](Images/erase-using-STM32CubeProgrammer.png )
2021-10-07 21:55:33 -07:00
2023-01-06 17:10:33 -08:00
7. close STM32CubeProgrammer, unplug USB cable, plug USB cable, open STM32CubeProgrammer.
2021-10-07 21:55:33 -07:00
2023-01-06 17:10:33 -08:00
8. program like on the picture
2021-10-07 21:55:33 -07:00
2023-01-06 17:10:33 -08:00
![x ](Images/program-using-STM32CubeProgrammer.png )