October 04, 2024, 08:52:29 AM

linux ./dfu-util -l returns empty

Started by andrewg, July 21, 2016, 10:45:49 AM

Previous topic - Next topic

andrewg

hi all, need help

powered up a newly bought OLIMEXINO-STM32

installed the maple IDE and dfu-utils (i've tried both using stock dfu-util from the IDE package and recompiled dfu-util from source (http://dfu-util.sourceforge.net/)

then on the command line run:

> ./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/

-----------
returns nothing - OLIMEXINO-STM32 is not detected as a DFU device

what is wrong?

i've tried "perpetual bootloader" as documented in:
https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/resources/Olimexino-STM32_Installation.pdf

the device is in slow blinks from the start at power up/boot and after the "perpetual bootloader" steps it is still the same.
and dfu-util -l returns nothing. (there are trouble installing the sketch via the IDE, but i'd guess this symptom is closer to the source of the problem)

note that
> lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 058f:6364 Alcor Micro Corp. AU6477 Card Reader Controller
Bus 003 Device 008: ID 1eaf:0004  << yup maple OLIMEXINO-STM32 is connected
Bus 003 Device 003: ID 2687:fb01 
Bus 003 Device 002: ID 2516:001f 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


LubOlimex

Hey,

Each OLIMEXINO-STM32 board is tested and programmed with Maple IDE after assembly. It is quite likely something at your side, since setting MAPLE IDE is not a very straight forward task.

Did you adjust the USB permissions? Did you follow the installation instructions here: http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/maple-ide-install.html#linux

Unfortunately, MAPLE IDE is a completely dead project now, and some of the installation instructions might be outdated.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

andrewg

thanks for the quick response! :)
it isn't permissions, i did sudo ./dfu-util -l (i.e. root permissions) and it returns empty as well.
i'd try setting it up in windows with the driver another time.

LubOlimex

Hey,

I meant udev rules. This grants permissions to Maple IDE or other software tools to access the board via the USB port. Maybe check here also:

https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Using-a-generic-stm32-board-on-linux-with-Maple-bootloader

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

JohnS

It could be as simple as -l not working but as this is essentially dead software you probably need to get the code and read it then debug whatever is wrong.

John

andrewg

#5
thanks for the replies, i'd guess i'm newbie to the platform i.e. arduino/maple hence there's a learning curve.

had some further progress in linux but still unsuccessful:

Quote
> sudo lsusb -v -d 1eaf:0004

Bus 003 Device 060: ID 1eaf:0004 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1eaf
  idProduct          0x0004
  bcdDevice            2.00
  iManufacturer           1 LeafLabs
  iProduct                2 Maple R3
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
...
    Interface Descriptor:
...
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0
...
Device Status:     0x0000
  (Bus Powered)

while installing the sketch from maple IDE:
(IDE source http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/maple-ide-install.html)

Quote
Going to build using 'armcompiler' (ARM)
        Compiling core...
        No libraries to compile.
        Compiling the sketch...
        Linking...
        Computing sketch size...

/tmp/build8141792718015285790.tmp/sketch_jul21a.cpp.bin  :
section    size   addr
.data   12984      0
Total   12984

Binary sketch size is reported above. Check it against a 108000 byte maximum.
Loading via dfu-util
Resetting to bootloader via DTR pulse
Searching for DFU device [1eaf:0004]...
Found it!

No DFU capable USB device found

linux dmesg outputs:
Quote
[10754.373756] usb 3-6: USB disconnect, device number 59
[10754.655951] usb 3-6: new full-speed USB device number 60 using xhci_hcd
[10754.820752] usb 3-6: New USB device found, idVendor=1eaf, idProduct=0004
[10754.820754] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[10754.820755] usb 3-6: Product: Maple R3
[10754.820756] usb 3-6: Manufacturer: LeafLabs
[10754.820837] usb 3-6: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[10754.821163] cdc_acm 3-6:1.0: ttyACM0: USB ACM device

the orginal maple documentation seem to suggest that a reset done by the maple IDE - DTR "1eaf" is successful
http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/bootloader.html#maple-rev3-rev5-dfu

however, apparently the device remains as a USB serial device rather than being in DFU mode/device after reset. (note that the slow blink of the led is still observable after boot/reset, is this 'slow blink' intended to signal that the device is in DFU mode?

this happens despite attempts with the 'perpetual bootloader mode' (maybe it may be my finger mistakes :P):
http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/troubleshooting.html#perpetual-bootloader-mode
https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/resources/Olimexino-STM32_Installation.pdf

taking a break off this for now, would explore a little further. but it'd seem the last resort would be to re-flash the bootloader (taking it off 'simple' usb sketch install steps)
would need to 'google it' further just in case it is after all related to some hardware problems (e.g. usb3?) on the host.

andrewg

#6
ordered ARM-USB-TINY-H - probably as hard-core as it gets 
https://www.olimex.com/Products/ARM/JTAG/ARM-USB-TINY-H/

btw a compliment, Olimex has nice complete set of tools to play with STM32 set of boards (many of which made by Olimex as well). I'm newbie to MCUs & *duino / maple, but arm stm32 is an interesting and staggering platform to get into MCUs, accordingly there are more than 1.5billion stm32 devices going round the world & counting
https://www.facebook.com/STM32/photos/a.150152205025171.27604.104648066242252/1138024442904604/?type=3&theater

:)

andrewg

#7
yes i did it! the culprit - my finger errors, thanks for all that help :D


https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/resources/Olimexino-STM32_Installation.pdf
Quote
Hit the reset button on your Maple (it's the small button at the bottom left, labeled
RESET). Notice that it blinks quickly 6 times, then blinks slowly a few more times.
Hit reset again, and this time push and hold the other button **during** the 6 fast blinks
(the button is on the top right; it is labeled BUT). You can release it once the slow
blinks start.
Your Maple is now in perpetual bootloader mode.

other finger mistakes may put the device in serial update (serial flash update) mode, the led stops blinking
http://embedded-lab.com/blog/stm32-programming-tips-and-tricks/

----
when the board is in DFU boot loader mode, in linux, it uses device 1eaf:0003 instead of 1eaf:0004

Quote> sudo lsusb -v -d 1eaf:0003

Bus 003 Device 044: ID 1eaf:0003 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1eaf
  idProduct          0x0003
  bcdDevice            2.00
  iManufacturer           1 LeafLabs
  iProduct                2 Maple 003
  iSerial                 3 LLM 003
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           36
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      2
      iInterface              4 DFU Program RAM 0x20000C00
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      2
      iInterface              5 DFU Program FLASH 0x08005000
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        1
          Will Not Detach
          Manifestation Intolerant
          Upload Unsupported
          Download Supported
        wDetachTimeout                  65535 milliseconds
        wTransferSize                    1024 bytes
        bcdDFUVersion                   0.01
Device Status:     0x0001
  Self Powered

Quote> dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [1eaf:0003] ver=0200, devnum=44, cfg=1, intf=0, alt=1, name="DFU Program FLASH 0x08005000", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0200, devnum=44, cfg=1, intf=0, alt=0, name="DFU Program RAM 0x20000C00", serial="LLM 003"

sketch install from maple ide:
QuoteGoing to build using 'armcompiler' (ARM)
        Compiling core...
        No libraries to compile.
        Compiling the sketch...
        Linking...
        Computing sketch size...

/tmp/build8700154956568391079.tmp/sketch_jul21a.cpp.bin  :
section    size   addr
.data   12992      0
Total   12992


Binary sketch size is reported above. Check it against a 108000 byte maximum.
Loading via dfu-util
Resetting to bootloader via DTR pulse

Reset via USB Serial Failed! Did you select the serial right serial port?
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming...


Searching for DFU device [1EAF:0003]...
Found it!

Opening USB Device 0x1eaf:0x0003...
Found Runtime: [0x1eaf:0x0003] devnum=44, cfg=0, intf=0, alt=1, name="DFU Program FLASH 0x08005000"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=259
Starting download: [##################################################] finished!
error resetting after download: No such file or directory
state( 8 ) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode

JohnS