Hi,
I'm having STMicroelectronics device which is in dfu mode i want to do upgrade but i'm unable to get python code to solve this problem. please help me.
STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
Hi,
Which ST device do you have? What sort of board? Are you able to get it into DFU mode with the BOOT0 pin?
Your best bet is to use dfu-util (see https://www.hanselman.com/blog/HowToFix ... ndows.aspx if you're using Windows), or the official ST tools.
Otherwise you can use pydfu.py which is part of hte MicroPython repo. https://github.com/micropython/micropyt ... s/pydfu.py
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
https://github.com/premananda8/usb/blob ... _libusb.py
please see above code using libusb in that code i want solution i'm not getting serial number when device is DFU, code is working perfectly when device is not in dfu mode. please help me.
please see above code using libusb in that code i want solution i'm not getting serial number when device is DFU, code is working perfectly when device is not in dfu mode. please help me.
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
When the device is in DFU mode, shows the serial number at the end of each memory region:
Code: Select all
dfu-util --list
Code: Select all
$ dfu-util --list
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/
Found DFU: [0483:df11] ver=2200, devnum=2, cfg=1, intf=0, path="20-2", alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="336133663433"
Found DFU: [0483:df11] ver=2200, devnum=2, cfg=1, intf=0, path="20-2", alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="336133663433"
Found DFU: [0483:df11] ver=2200, devnum=2, cfg=1, intf=0, path="20-2", alt=1, name="@Option Bytes /0x1FFFC000/01*016 e", serial="336133663433"
Found DFU: [0483:df11] ver=2200, devnum=2, cfg=1, intf=0, path="20-2", alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="336133663433"
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
With the following change to micropython/tools/pydfu.py running pydfu.py --list will show the serial number:
Here's the output of pydfu.py --list with the above change:
Code: Select all
diff --git a/tools/pydfu.py b/tools/pydfu.py
index 658ce59ae..7236f838c 100755
--- a/tools/pydfu.py
+++ b/tools/pydfu.py
@@ -462,9 +462,10 @@ def list_dfu_devices(*args, **kwargs):
print("No DFU capable devices found")
return
for device in devices:
- print("Bus {} Device {:03d}: ID {:04x}:{:04x}"
+ print("Bus {} Device {:03d}: ID {:04x}:{:04x} Serial {}"
.format(device.bus, device.address,
- device.idVendor, device.idProduct))
+ device.idVendor, device.idProduct,
+ get_string(device, device.iSerialNumber)))
layout = get_memory_layout(device)
print("Memory Layout")
for entry in layout:
Code: Select all
$ ./pydfu.py --list
Bus 3 Device 005: ID 0483:df11 Serial 336133663433
Memory Layout
0x8000000 4 pages of 16K bytes
0x8010000 1 pages of 64K bytes
0x8020000 7 pages of 128K bytes
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
it always coming to No DFU capable devices found
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
If it's coming up with no DFU devices detected, then your device isn't in DFU mode (or you have a bad USB cable). You need to connect BOOT0 needs to be high, and BOOT1 needs to be low, then RESET. That should put your device in DFU mode.
What board are you using?
What board are you using?
Re: STMicroelectronics device having dfu mode i want to detect serial number using python. i'm not getting any soluton.
Are you on Linux? does `dmesg` show anything when you connect the device?
Does `sudo dfu-util --list` help? If so you might need to check your udev rules.
Does `sudo dfu-util --list` help? If so you might need to check your udev rules.