![]() |
Forum Index : Microcontroller and PC projects : MINT: STCube Programmer in Linux....
![]() ![]() |
|||||
Author | Message | ||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
Rob, a dump from my setup ' Mint 20.2 with latest software updates installed ' dmesg -w dump of disconnect/re-connect for several devices ' USB disconnect/re-connect of Pico with ext 5V [189260.569184] usb 2-2.1: USB disconnect, device number 17 [189260.569839] xhci_hcd 0000:00:14.0: WARN Cannot submit Set TR Deq Ptr [189260.569840] xhci_hcd 0000:00:14.0: A Set TR Deq Ptr command is pending. [189262.583470] usb 2-2.1: new full-speed USB device number 18 using xhci_hcd [189262.704742] usb 2-2.1: New USB device found, idVendor=2e8a, idProduct=000a, bcdDevice= 1.00 [189262.704748] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [189262.704752] usb 2-2.1: Product: Pico [189262.704755] usb 2-2.1: Manufacturer: Raspberry Pi [189262.704758] usb 2-2.1: SerialNumber: E660443043789921 [189262.715855] cdc_acm 2-2.1:1.0: ttyACM4: USB ACM device ' USB disconnect/re-connect of STMicro F407 with VBUS 5V [189306.905262] usb 2-2.3: USB disconnect, device number 5 [189309.174590] usb 2-2.3: new full-speed USB device number 19 using xhci_hcd [189309.280994] usb 2-2.3: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00 [189309.281000] usb 2-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [189309.281004] usb 2-2.3: Product: STM32 Virtual ComPort [189309.281007] usb 2-2.3: Manufacturer: STMicroelectronics [189309.281009] usb 2-2.3: SerialNumber: 20723771564B [189309.289611] cdc_acm 2-2.3:1.0: ttyACM0: USB ACM device ' USB disconnect/re-connect of Circuit Gizmos 470 board via 1455 USB/serial with ext 9V [189329.433545] usb 2-2.4.4: USB disconnect, device number 16 [189333.751834] usb 2-2.4.4: new full-speed USB device number 20 using xhci_hcd [189333.854738] usb 2-2.4.4: string descriptor 0 read error: -32 [189333.854750] usb 2-2.4.4: New USB device found, idVendor=04d8, idProduct=000a, bcdDevice= 1.00 [189333.854754] usb 2-2.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [189333.863465] cdc_acm 2-2.4.4:1.0: ttyACM3: USB ACM device [189352.473617] usb 2-2.4.3: USB disconnect, device number 15 ' USB disconnect/re-connect of Peter Mather 470 board via 1455 USB/serial with ext 9V [189354.487873] usb 2-2.4.3: new full-speed USB device number 21 using xhci_hcd [189354.590657] usb 2-2.4.3: string descriptor 0 read error: -32 [189354.590667] usb 2-2.4.3: New USB device found, idVendor=04d8, idProduct=000a, bcdDevice= 1.00 [189354.590671] usb 2-2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [189354.599955] cdc_acm 2-2.4.3:1.0: ttyACM2: USB ACM device ' USB disconnect/re-connect of CMM2 with VBUS 5V [189815.833658] usb 2-2.1: USB disconnect, device number 22 [189820.665339] usb 2-2.1: new full-speed USB device number 23 using xhci_hcd [189820.768996] usb 2-2.1: string descriptor 0 read error: -32 [189820.769010] usb 2-2.1: New USB device found, idVendor=04d8, idProduct=000a, bcdDevice= 1.00 [189820.769014] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [189820.777906] cdc_acm 2-2.1:1.0: ttyACM4: USB ACM device ^C doug@GarageMint20:~$ Cheers, Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
hi panky, much appreciate the information. unfortunately, it is not quite what i am looking for - largely my fault for not being clearer in my previous post. i'm interesting in the output from dmesg -w when the device is plugged and then unplugged while in DFU firmware upload mode. of the devices you have, the F407 and CMM2 support this mode. in the case of the CMM2, follow the instructions in Appendix G of the User Manual, "Loading the Firmware" using a USB A to USB A cable connecting the 'keyboard' port on the CMM to the PC, and with jumpers in positions as if about to upload new firmware. no need to run the Cube software, just plug in, wait a few seconds, then unplug. similarly for the F407 board, go through whatever process is normal for uploading new firmware but without needing to actually do so. it may involve a jumper, a switch, or pressing a 'program' button while plugging in. in both cases the devices should in some way be identified in the dmesg log as 'USB DFU', instead of 'USB ACM' or CDC. and, since ST Micros devices, the VID:PID should (i think) be 04d8:df11. cheers, rob :-) |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
Rob, F407 in boot mode [198295.070034] usb 2-2.4.3: USB disconnect, device number 44 [198299.655382] usb 2-2.4.3: new full-speed USB device number 45 using xhci_hcd [198299.760727] usb 2-2.4.3: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00 [198299.760741] usb 2-2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [198299.760746] usb 2-2.4.3: Product: STM32 BOOTLOADER [198299.760750] usb 2-2.4.3: Manufacturer: STMicroelectronics [198299.760754] usb 2-2.4.3: SerialNumber: 20723771564B [198347.550127] usb 2-2.4.3: USB disconnect, device number 45 [198354.435742] usb 2-2.4.3: new full-speed USB device number 46 using xhci_hcd [198354.537524] usb 2-2.4.3: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00 [198354.537530] usb 2-2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [198354.537533] usb 2-2.4.3: Product: STM32 BOOTLOADER [198354.537536] usb 2-2.4.3: Manufacturer: STMicroelectronics [198354.537539] usb 2-2.4.3: SerialNumber: 20723771564B ^C ** with F407 connected doug@GarageMint20:~$ sudo dfu-util -l [sudo] password for doug: 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=46, cfg=1, intf=0, path="2-2.4.3", alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="20723771564B" Found DFU: [0483:df11] ver=2200, devnum=46, cfg=1, intf=0, path="2-2.4.3", alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="20723771564B" Found DFU: [0483:df11] ver=2200, devnum=46, cfg=1, intf=0, path="2-2.4.3", alt=1, name="@Option Bytes /0x1FFFC000/01*016 e", serial="20723771564B" Found DFU: [0483:df11] ver=2200, devnum=46, cfg=1, intf=0, path="2-2.4.3", alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="20723771564B" ** with F407 unconnected doug@GarageMint20:~$ sudo dfu-util -l 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/ doug@GarageMint20:~$ Interestingly (from my point of view ![]() Doug. Edited 2021-12-17 16:22 by panky ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
You get the kernel log (as reported by dmesg) regardless of udev rules. You only need a rule to mention something very permissive (e.g. all USB, gulp) or specifying something like 483 or df11 or both to allow non-root access. Rob - I have lots but all STM32 (from F103 to F4xx to F7xx to H7xx) and they all report 483:df11 in DFU, as you'd expect. John |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
that dmesg output is what i was after ![]() when using sudo to start up the program dfu-util, you are first switched to user root level privileges, then afterwards switched back to a normal user. while running as root you can do anything, all the normal security limitations are bypassed. generally, one should use sudo with care, due to the amount of accidental damage a program can do with root privileges. john: it looks like a whole load of different chip and product manufacturers support DFU mode, including: TI, NPX, microchip, and most apple products. each uses one or more different VID:PID pairs (atmel have several). so hard-wiring 0x0483:0xdf11 into a generic utility intended to solve the sort of problems grogster faced is not going to work so well. grogster's problems would have been solved if there was a simple right-click->run-as-admin option coded into all linux desktop flavours, but alas there is not - i suspect largely because the distro authors could see it being over-used and creating more problems than it solved. cheers, rob :-) Edited 2021-12-17 22:29 by robert.rozee |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
I have four BlackPill modules. If you want one to play with Rob, let me know and I can send one to you. Smoke makes things work. When the smoke gets out, it stops! |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
if you don't have a use for it, it would certainly be useful in testing an 'automatic' setup utility ![]() cheers, rob :-) |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
I'll send you one. Due to the PicoMite now having colour VGA, I don't really need the BlackPill modules anymore. An automatic utility sounds like a great idea. I only know I had a huge amount of trouble getting it to work for me, and I could not have done it without help from the members here. You're right - it's surprising something like that has not already been created. Smoke makes things work. When the smoke gets out, it stops! |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
as promised, a small linux utility (32- and 64-bit) to create the rule for any DFU device, which also has buttons to adds the current user to plugdev or dialout groups: DFUfix (2022-01-04).zip just three buttons: 1. run the program, then plug in your STM32 device. the VID and PID displayed update whenever a device is plugged in, so you can plug in a 'black pill', then press the Boot0 and nRST buttons as required to reboot it into DFU mode. basically do whatever is needed until the right VID and PID are displayed. 2. press the top button and enter your password when asked. a new rule is created to allow members of the 'plugdev' group to access to the device. 3. press the middle button to add yourself to the 'plugdev' group - you will be prompted to enter your password again. 4. press the bottom button to... add yourself to the 'dialout' group. needed to access serial ports, as we have all discovered! ![]() the flashing asterix at the top left of the screen indicates that the dmesg utility is running in the background, which is how the utility knows when USB devices have been plugged in. full source code (lazarus 2.0.12) included in the archive. the 'interesting' code is in the files unit1.pas (the GUI program) and unit2.pas (console code to manipulate the rule file). the utility pkexec is used to gain root access when required, and should already be installed on most desktop distros. cheers, rob :-) Edited 2022-01-04 02:03 by robert.rozee |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Excellent. ![]() I have a Mint laptop I have not tried to use the Cube programmer on yet, so I will try this out and let the thread know what happens, but I expect your little app to fix the issue very painlessly. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |