adafruit / Adafruit_Adalink

Python wrapper for Segger's J-Link Commander & STMicro STLink V2 to flash various ARM MCUs
MIT License
125 stars 33 forks source link

JLink no longer works under El Capitan? #14

Closed microbuilder closed 8 years ago

microbuilder commented 8 years ago

I just updated to El Capitan, and unfortunately AdaLink no longer seems to work with the JLink (reported by a second person as well). I tried reinstalling the JLink drivers, but haven't been able to get it to work.

The device is connected here and the STM32F2 board is powered up (the same setup that worked fine on 10.10):

$ adalink stm32f2 -p jlink -i
Traceback (most recent call last):
  File "/usr/local/bin/adalink", line 9, in <module>
    load_entry_point('adalink==2.0.2', 'console_scripts', 'adalink')()
  File "/Library/Python/2.7/site-packages/click-4.0-py2.7.egg/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click-4.0-py2.7.egg/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click-4.0-py2.7.egg/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click-4.0-py2.7.egg/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click-4.0-py2.7.egg/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/Users/ktown/Dropbox/microBuilder/Code/Python/Adafruit_Adalink/adalink/core.py", line 78, in _callback
    raise AdaLinkError('Could not find {0}, is it connected?'.format(self.name))
adalink.errors.AdaLinkError: Could not find stm32f2, is it connected?

jlink is available in the system path since running jlinkexe produces the following output after a certain delay:

$ jlinkexe
SEGGER J-Link Commander V5.02f ('?' for help)
Compiled Oct  2 2015 20:55:08
Can not connect to J-Link via USB.
J-Link>

I'm using the latest available JLink drivers, so this may simply be an issue with the Segger driver, but wanted to file it here as a known issue all the same.

microbuilder commented 8 years ago

Clearly we're not alone, though. I wasn't aware of the USB stack issues referenced here: http://community.silabs.com/t5/Simplicity-Studio-and-Software/OS-X-El-Capitan-Can-t-connect-to-device/td-p/155102

microbuilder commented 8 years ago

Updating the firmware on the JLink (5.02f was used) seems to have solved this, though I had to connect the JLink to a Windows device and then open JLink Commander to update.

The OS X software doesn't propose the option to update the firmware. :(

screen shot 2015-10-05 at 09 14 35

I did this in Parallels, and then when I closed Parallels I was able to use the JLink on El Capitan again:

$ adalink stm32f2 -p jlink -i
Device ID : STM32F2xx
Chip Rev  : X (0x2003)
Segger ID : STM32F205RG