OSX 10.9 Maple Mini Ardunio 1.6.5 libusb-1.0.0.dylib

quarterturn
Tue Aug 18, 2015 9:58 pm
I have a “Baite” Maple Mini clone I am attempting to use on OSX 10.9 and Arduino 1.6.5. The board programs fine under Windows, but I seem to have a library issue on OSX:

$ ./dfu-util
dyld: Library not loaded: /usr/local/lib/libusb-1.0.0.dylib
Referenced from: /Applications/Arduino-1.6.5.app/Contents/Java/hardware/Arduino_STM32/tools/macosx/dfu-util/./dfu-util
Reason: image not found
Trace/BPT trap

A copy exists here /Applications/Arduino-1.6.5.app/Contents/Java/hardware/tools/avr/lib/libusb-1.0.0.dylib but that version doesn’t work.

Pretty much the same result from Arduino IDE (expected, as it uses the same utility):

dyld: Library not loaded: /usr/local/lib/libusb-1.0.0.dylib
Referenced from: /Applications/Arduino-1.6.5.app/Contents/Java/hardware/Arduino_STM32/tools/macosx/dfu-util/dfu-util
Reason: image not found
/Applications/Arduino-1.6.5.app/Contents/Java/hardware/Arduino_STM32/tools/macosx/maple_upload: line 53: 69913 Trace/BPT trap: 5 ${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr}

Does USB programming even work under OSX? I have a USB-Serial adapter, but it’s pretty convenient to use the USB for power and programming at the same time.


RogerClark
Tue Aug 18, 2015 10:07 pm
upload via usb was definitly working on OSX, many people have used it.

However its possible there is some issue with IDE 1.6.5,

Try IDE 1.6.4


quarterturn
Tue Aug 18, 2015 10:39 pm
I got past the libusb issue with an OSX package here:
http://rudix.org/packages/libusb.html

But, I think now the issue is OSX is not really seeing the board as a USB device:
dfu-util: Invalid DFU suffix signature
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to [email protected]

Deducing device DFU version from functional descriptor length
dfu-util: No DFU capable USB device available


quarterturn
Tue Aug 18, 2015 10:47 pm
Actually, it does appear to be seen on USB:
Maple:

Product ID: 0x0004
Vendor ID: 0x1eaf
Version: 2.00
Speed: Up to 12 Mb/sec
Manufacturer: LeafLabs
Location ID: 0xfa134200 / 14
Current Available (mA): 500
Current Required (mA): 100

Is it maybe just very timing critical when compiling ends and you reset the board before uploading?


RogerClark
Wed Aug 19, 2015 12:12 am
Which bootloader are you using.

The original one of the new stm32duino bootloader

i.e if you have not updated the bootloader you are running the old one.


quarterturn
Wed Aug 19, 2015 12:13 am
It’s what came with the board.

RogerClark
Wed Aug 19, 2015 12:31 am
Ah, OK.

We thought there may be issues with the new bootloader being too fast for some OSX systems, specifically older macs and when you connect via an external hub.

Did you try putting the board into perpetual bootloader mode (please google this there is a youtube video on how to do it)


quarterturn
Wed Aug 19, 2015 1:53 am
I found the guide for perpetual bootloader and tried it. It didn’t help. Here’s the error:

Sketch uses 12,604 bytes (10%) of program storage space. Maximum is 122,880 bytes.
Global variables use 3,112 bytes of dynamic memory.
/Applications/Arduino-1.6.5.app/Contents/Java/hardware/Arduino_STM32/tools/macosx/maple_upload cu.usbmodemfa13431 2 1EAF:0003 /var/folders/rk/gfzqk2kd3_bfxvg0cfk3fdg40000gn/T/build7208509584741567715.tmp/Fading.cpp.bin
dfu-util 0.8

dfu-util: Invalid DFU suffix signature
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to [email protected]

Deducing device DFU version from functional descriptor length
dfu-util: No DFU capable USB device available

Here’s what the system shows on the USB bus:
Maple 003:

Product ID: 0x0003
Vendor ID: 0x1eaf
Version: 2.01
Serial Number: LLM 003
Speed: Up to 12 Mb/sec
Manufacturer: LeafLabs
Location ID: 0xfa134200 / 14
Current Available (mA): 500
Current Required (mA): 100

(looks like just the product ID changed)


quarterturn
Wed Aug 19, 2015 1:54 am
BTW I was wrong on the OS, it’s 10.10 and the hardware is: iMac (27-inch, Mid 2011)

RogerClark
Wed Aug 19, 2015 3:31 am
I suspect somehow the wrong version of dfu util is being run.

Can you find out if you have more than one version installed.

I’ll fire up my Mac and take a look at what version mine is reporting


RogerClark
Wed Aug 19, 2015 3:41 am
I get


Sketch uses 12,100 bytes (10%) of program storage space. Maximum is 110,592 bytes.
Global variables use 3,104 bytes of dynamic memory.
/Users/administrator/Documents/Arduino/hardware/Arduino_STM32/tools/macosx/maple_upload cu.usbmodem1d121 1 1EAF:0003 /var/folders/6p/knbk6cr92sscwh62_5tt20ph0000gn/T/build7155389110481267417.tmp/sketch_aug19a.cpp.bin
dfu-util 0.8
dfu-util: Invalid DFU suffix signature

dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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 [email protected]

Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device

Download [ ] 0% 0 bytes
Download [= ] 7% 1024 bytes
Download [=== ] 15% 2048 bytes
Download [===== ] 23% 3072 bytes
Download [======= ] 31% 4096 bytes
Download [========= ] 39% 5120 bytes
Download [=========== ] 46% 6144 bytes
Download [============= ] 54% 7168 bytes
Download [=============== ] 62% 8192 bytes
Download [================= ] 70% 9216 bytes
Download [=================== ] 78% 10240 bytes
Download [===================== ] 85% 11264 bytes
Download [======================= ] 93% 12100 bytes
Download [=========================] 100% 12100 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode


quarterturn
Wed Aug 19, 2015 2:22 pm
I’m at work at the moment so I can’t give you the exact error, but basically when I run dfu-util with any option I get an error about “invalid image” – even just -v for version. So I suspect dfu-util or libusb or both at this point.

dfu-util came from the github repo package for Arduino, which I cloned very recently.


martinayotte
Wed Aug 19, 2015 3:06 pm
I remember seeing that “invalid image” when files are *.bin not *.dfu.
In such case, I’ve resolved it in F4 by using “–dfuse-address 0x8000000” option.

quarterturn
Wed Aug 19, 2015 7:26 pm
I guess I’ll try “homebrew” to build and install dfu-util on my Mac later tonight. Not sure what’s wrong with the version from github.

RogerClark
Wed Aug 19, 2015 9:55 pm
When i get a chance, I will Pull the latest version onto my Mac, in case some seemingly unrelated change has broken dfu-util

There was a change to the lunix version about 2 weeks ago, but it should not effect the OSX version


quarterturn
Wed Aug 19, 2015 11:44 pm
I got it working on OSX 10.10. Here’s how:
1. installed ‘brew’
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homeb … er/install)”
2. installed dfu-util
brew install dfu-util
3. deleted the Arduino 1.6.5 dfu-util from the STM32 github repo
rm /Applications/Arduino-1.6.5.app/Contents/Java/hardware/Arduino_STM32/tools/macosx/dfu-util/dfu-util
4. linked the new dfu-util to where the deleted was
ln -s /usr/local/bin/dfu-util dfu-util

it works:

$ /usr/local/bin/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 [email protected]

Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:8215] ver=0208, devnum=8, cfg=1, intf=3, alt=0, name=”UNKNOWN”, serial=”7CC3A151AE16″

Now I’d like to get the new firmware on so it’s time to solder on some pins to my board. Does the new firmware solve needing to press the reset button to upload?


RogerClark
Thu Aug 20, 2015 1:58 am
No need to solder to the board.

There is an updater sketch in the repo somewhere, i.e in the stm32duino-bootloader

Just load the sketch and press Y etc

Use at your own risk ;-)


quarterturn
Thu Aug 20, 2015 2:56 am
I found the firmware updater and applied it. It seems to give more time after pressing the reset button for code uploading vs the original.

Thank you very much for your help!


RogerClark
Thu Aug 20, 2015 3:07 am
On OXS and Linux the new bootloader is significantly faster to upload than the old one.

Additional it free’s up another 12k of Flash and another 3k of RAM (i.e the increase of RAM is the most important change)

Remember to select the correct bootloader option to get the extra flash and ram


DaveCalaway
Tue Jan 17, 2017 8:41 pm
quarterturn wrote:I got it working on OSX 10.10. Here’s how:
1. installed ‘brew’
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homeb … er/install)”
2. installed dfu-util
brew install dfu-util
3. deleted the Arduino 1.6.5 dfu-util from the STM32 github repo
rm /Applications/Arduino-1.6.5.app/Contents/Java/hardware/Arduino_STM32/tools/macosx/dfu-util/dfu-util
4. linked the new dfu-util to where the deleted was
ln -s /usr/local/bin/dfu-util dfu-util

DaveCalaway
Wed Jan 18, 2017 9:44 pm
UPDATE

I upgraded the bootloader to 2.0, this is the result on Arduino. I left the IDE with the same setting above:
dfu-util 0.9
dfu-util: Invalid DFU suffix signature

dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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/

Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #2 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device

Download [ ] 0% 0 bytes
Download [= ] 7% 1024 bytes
Download [=== ] 14% 2048 bytes
Download [===== ] 22% 3072 bytes
Download [======= ] 29% 4096 bytes
Download [========= ] 37% 5120 bytes
Download [=========== ] 44% 6144 bytes
Download [============ ] 51% 7168 bytes
Download [============== ] 59% 8192 bytes
Download [================ ] 66% 9216 bytes
Download [================== ] 74% 10240 bytes
Download [==================== ] 81% 11264 bytes
Download [====================== ] 88% 12288 bytes
Download [======================== ] 96% 12796 bytes
Download [=========================] 100% 12796 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode


Leave a Reply

Your email address will not be published. Required fields are marked *