cancel
Showing results for 
Search instead for 
Did you mean: 

Fail to upgrade with DFU

Khira.1
Associate II

Hi all,

An LED is connected as below.

PA1 --- Resistor --- LED --- 3.3V

Build test.bin from source code shown below using STM32CubeIDE.

 while (1)

 {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_1);

  HAL_Delay(200);

 }

Create test.dfu from the test.bin.

Connect a board to PC via USB, and "STM Device in DFU Mode" appears in Device Manager.

Try to upgrade the test.dfu into the board using DfuSeDemo.

A message "Your device was plugged in DFU mode. So it is impossible to make sure this file is correct for this device." pops up.

Click "YES."

A message "Upgrade successful !" is shown.

Disconnect USB from the PC, connect BOOT0 to GND and re-connect USB to the PC.

An LED blinks with an interval of 2sec. Which maybe a demo exe pre-installed. So, it seems to fail to install my program.

Could anybody tell me solution?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you.

It works well with *.dfu created from *.hex.

And, *.hex can be created under settings as below.

  1. Select "Properties" in a list shown by right click on the project
  2. Click "Settings" in "C/C++ Build"
  3. In "Tool Settings" tab, select "MCU Post build outputs"
  4. Check on "Convert to Intel Hex file (-O ihex)"
  5. Click "Apply and Close" button

View solution in original post

2 REPLIES 2
MM..1
Chief II

Create your dfu from hex, not from bin.

Thank you.

It works well with *.dfu created from *.hex.

And, *.hex can be created under settings as below.

  1. Select "Properties" in a list shown by right click on the project
  2. Click "Settings" in "C/C++ Build"
  3. In "Tool Settings" tab, select "MCU Post build outputs"
  4. Check on "Convert to Intel Hex file (-O ihex)"
  5. Click "Apply and Close" button