Skip to main content
KNam.2
Associate II
June 6, 2023
Question

A dfu error occurs when downloading an image

  • June 6, 2023
  • 1 reply
  • 2897 views

I am currently developing using the STM32MP157FAD. And I want to create a distribution image and download the image using STM32CubeProgrammer.

However, while downloading the image, the following error message is displayed in the log of STM32CubeProgrammer.

15:34:17:270 : DFU status = 0

15:34:17:270 : DFU State = 5

15:34:17:270 : Segment[0] downloaded successfully

15:34:17:270 : File download complete

15:34:17:270 : Time elapsed during download operation: 00:00:01.440

15:34:17:270 : RUNNING Program ...

15:34:17:270 : PartID: :0x01

15:34:17:270 : DFU status = 0

15:34:17:270 : DFU State = 5

15:34:17:270 : sending a dfu end of download request

15:34:17:270 : DFU status = 0

15:34:17:271 : DFU State = 7

15:34:22:259 : DFU status = 0

15:34:22:259 : DFU State = 2

15:34:22:259 : sending a set alternate setting request with index: 5

15:34:27:259 : receiving packet

15:34:32:260 : sending a clear status request

15:34:42:262 : an error occured after sending the clear status request

15:34:42:262 : Status: errUNKNOWN, State: dfuERROR

15:34:42:262 : sending a clear status request

15:34:52:263 : an error occured after sending the clear status request

15:34:52:263 : Status: errUNKNOWN, State: dfuERROR

An error message is continuously displayed and the connection with the device is disconnected, and the following error is displayed.

16:18:01:268 : unable to switch the device to dfuIDLE state

 16:18:01:268 : Error: an error occured while uploading data from the virtual partition 0xF1

 16:18:01:288 : Error: Start operation failed at partition 0x01

 16:18:01:312 : Error: TSV flashing service failed

 16:18:46:271 : Warning: Connection to device 0x500 is lost

 16:19:51:499 : Disconnected from device.

For OTG Device Tree, refer to the following site.

https://wiki.st.com/stm32mpu/wiki/OTG_device_tree_configuration#DT_configuration_example_as_high-speed_OTG_in_Host_or_Peripheral_mode-2C_with_micro-B_or_Type-C_connector-2C_and_with_VBUS_and_ID_left_unconnected

&usbotg_hs{

pinctrl-names = "default", "sleep";

pinctrl-0 = <&usb_otg_hs_pins_mx>;

pinctrl-1 = <&usb_otg_hs_sleep_pins_mx>;

compatible = "st,stm32mp15-hsotg", "snps,dwc2";

phys = <&usbphyc_port1 0>; 

phy-names = "usb2-phy";

u-boot,force-b-session-valid ;

dr_mode = "peripheral";

usb-role-switch;

role-switch-default-mode = "peripheral";

status = "okay";

/* USER CODE BEGIN usbotg_hs */

/* USER CODE END usbotg_hs */

};

I would be grateful if you could teach me how to solve this problem.

This topic has been closed for replies.

1 reply

PatrickF
Technical Moderator
June 6, 2023

HI @KNam.2​ 

could you double check that the TSV file is conform : https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout

Maybe have a look to https://wiki.st.com/stm32mpu/wiki/How_to_configure_U-Boot_for_your_board#USB_OTG_node

Which USB connector and surrounding HW on your custom board (e.g. Type-C with STUSB1600)

Please share the UART console output log ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
KNam.2
KNam.2Author
Associate II
June 7, 2023

NAND is used, there is no difference compared to the EV board TSV.


_legacyfs_online_stmicro_images_0693W00000dDGbBQAW.png

And the USB port was used as a test point without using a connector.


_legacyfs_online_stmicro_images_0693W00000dDGchQAG.png

​Finally, I did a pull-up on UART PA13, but no data is output. I wonder if there is a separate setting to use.