dart-archive / sdk

The Dartino project was an experiment seeking to improve productivity when writing application code for embedded devices.
https://dartino.org
Other
330 stars 36 forks source link

Flashing crashes on Mac: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib #554

Open kasperl opened 8 years ago

kasperl commented 8 years ago

This is running 0.5.0-dev.1.0 on a Macbook Pro after running dartino x-download-tools.

kasperl-macbookpro2:stm32f746g-discovery kasperl$ dartino flash disco-light.dart 
Using template settings file '/Users/kasperl/Dartino/dartino-sdk/internal/.dartino-settings'
Done building image: /Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin
Flashing image: /Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin
Failed to flash the image: /Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin

Please check that the device is connected and ready. In some situations un-plugging and plugging the device, and then retrying will solve the problem.

Output from the OpenOCD tool:

+ IMAGE_FILE=
+ BOARD=
+ SCRIPT_NAME=/Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh
+ '[' 3 -gt 0 ']'
+ case $1 in
+ BOARD=stm32f7discovery
+ shift 2
+ '[' 1 -gt 0 ']'
+ case $1 in
+ IMAGE_FILE=/Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin
+ shift
+ '[' '!' -z '' ']'
+ '[' 0 -gt 0 ']'
+ '[' -z /Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin ']'
+ '[' '!' -e /Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin ']'
+ '[' -z stm32f7discovery ']'
++ uname
+ OS=Darwin
+ case $OS in
+ OS=mac
++ follow_links /Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh
++ file=/Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh
++ '[' -h /Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh ']'
++ echo /Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh
+ PROG_NAME=/Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh
++ cd /Users/kasperl/Dartino/dartino-sdk/platforms/bin
++ pwd -P
+ SCRIPT_DIR=/Users/kasperl/Dartino/dartino-sdk/platforms/bin
+ source /Users/kasperl/Dartino/dartino-sdk/platforms/bin/setup-paths.shlib
++ DARTINO_SDK_DIR=/Users/kasperl/Dartino/dartino-sdk/platforms/bin
+++ dirname /Users/kasperl/Dartino/dartino-sdk/platforms/bin
++ DARTINO_SDK_DIR=/Users/kasperl/Dartino/dartino-sdk/platforms
+++ dirname /Users/kasperl/Dartino/dartino-sdk/platforms
++ DARTINO_SDK_DIR=/Users/kasperl/Dartino/dartino-sdk
++ TOOLCHAIN_DIR=/Users/kasperl/Dartino/dartino-sdk/tools/gcc-arm-embedded
++ OPENOCDHOME=/Users/kasperl/Dartino/dartino-sdk/tools/openocd/
++ EMUL8_HOME=/Users/kasperl/Dartino/dartino-sdk/tools/emul8
++ DARTINO=/Users/kasperl/Dartino/dartino-sdk/bin/dartino
++ DARTINO_FLASHIFY=/Users/kasperl/Dartino/dartino-sdk/bin/dartino-flashify
++ '[' '!' -d /Users/kasperl/Dartino/dartino-sdk/tools/gcc-arm-embedded ']'
+ STLINK=stlink-v2-1
+ /Users/kasperl/Dartino/dartino-sdk/tools/openocd//bin/openocd -f interface/stlink-v2-1.cfg -f board/stm32f7discovery.cfg --search /Users/kasperl/Dartino/dartino-sdk/tools/openocd//share/openocd/scripts -c init -c 'reset halt' -c 'flash write_image erase /Users/kasperl/Dartino/dartino-sdk/samples/stm32f746g-discovery/disco-light.bin 0x8000000' -c 'reset run' -c shutdown
dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
  Referenced from: /Users/kasperl/Dartino/dartino-sdk/tools/openocd//bin/openocd
  Reason: image not found
/Users/kasperl/Dartino/dartino-sdk/platforms/bin/flash.sh: line 97: 43381 Trace/BPT trap: 5       $OPENOCDHOME/bin/openocd -f interface/${STLINK}.cfg -f board/${BOARD}.cfg --search $OPENOCDHOME/share/openocd/scripts -c "init" -c "reset halt" -c "flash write_image erase $IMAGE_FILE 0x8000000" -c "reset run" -c "shutdown"
kasperl commented 8 years ago

This is probably "just" issue #455 rearing its ugly head. Can we make the error message better to help new users?