Hello,
i'm using dfu-util V. 0.9 in order to program STM32L412Kx micro controller flash, the host is raspberry pi Raspbian GNU/Linux 10 (buster) 6.1.34-v8+ #1657 SMP PREEMPT, micro controller bootloader fw version seems V01.00.00.
During programming quite often the procedure exit with :
**rssfbaut@raspberrypi:~/sx1302_hal/bin $ sudo dfu-util -a 0 -s 0x08000000:leave -t 0 -D ../mcu_bin/rlz_010000_CoreCell_USB.bin
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08000000, size = 35724
Download [= ] 5% 2048 bytesdfu-util: Error during special command "ERASE_PAGE" get_status
**
It is a known issue of dfu-util V 0.9 ? or is something different ?
Could you please suggest some hint in ordere to investigate further/solve ?
Thanks in advance
Best Regards
Fabio
Anonymous
Please try 0.11 or latest git, and paste the output. If on latest git, you can also try the ":fast" modifier.
Hi,
after this output very often the micro controller remain in BOOTLOADER.....
dfu-util -a 0 -s 0x08000000:leave -t 0 -D rlz_010000_CoreCell_USB.bin
dfu-util 0.11
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 0483:df11
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
Clearing status
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading element to address = 0x08000000, size = 35724
Erase [=========================] 100% 35724 bytes
Erase done.
Download [=========================] 100% 35724 bytes
Download done.
File downloaded successfully
Submitting leave request...
Transitioning to dfuMANIFEST state
So it seems erase and programming works fine without issues.
Are you sure it /remains/ in bootloader after the leave request, and that it doesn't reset and, for some reason or another (BOOTx pins?) boots into the bootloader again?
Hi,
what is the meaning of :
DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
After dfu-utils programming sometimes remain in bootloader sometimes not and expose the /dev/ttyACMx
Anyway i will try to invoke dfu-util 0.11 and after this put the boot pin off and reset the microcontroller
This is the status that the bootloader itself reports. I think it is just a bug in the ST bootloader. It would make sense if this status would be reported before anything is programmed (and there would be no run-time to go to), but I don't know if and how the bootloader tries to determine this. Maybe it is meant to check if there is a valid stack and boot vector at 0x08000000, but I don't know what your device bootloader is actually doing.
The dmesg output on the host may reveal if the device is actually resetting into bootloader again. Without knowing more, I suspect it is your setup that causes it to go into bootloader again.
why this error is not present in V 0.9 with the same bootloader ?
It is there in your 0.9 output as well:
v0.11 is more helpful with telling what "10" means.
thanks
Is there any indication there is something wrong in dfu-util still?
only still status 10. But now after programming i put the boot pin in off state and then i reset the uC. In this way dfu-util 0.11 seems works without any others issues.
BTW, why are you using
-t 0?