...get JLink to work on Mac OS X
UPDATE: The steps described in this article are not required if using version 4.70 or later of the J-Link software & documentation pack for MAC as it is no longer dependent on the libusb library. All you should need to do is set the 'J-Link > J-Link DLL File' target property to point to the libjlinkarm.4.dylib file contained in the pack.
NOTE: This article applies to CrossWorks for ARM version 2.3 onwards. J-Link is not supported in the Mac OS version of CrossWorks prior to version 2.3.
- Download the J-Link software & documentation pack for MAC from http://www.segger.com/jlink-software.html, open the .dmg file and copy the contents onto your hard drive.
- Download and install macports from http://www.macports.org if you have not done so already.
- Install libusb by running 'sudo port install libusb +universal' from the command line (make sure you have the +universal option so you get both 32-bit and 64-bit versions of libusb).
- Start CrossStudio with the DYLD_LIBRARY_PATH environment variable set to include the directory containing the libusb library you just installed (/opt/local/lib). To do this:
- Open a terminal and run the command 'export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH' then start CrossStudio from the command line by running '/Applications/CrossWorks for ARM 2.3/CrossStudio for ARM 2.3.app/Contents/MacOS/crossstudio'.
- In CrossStudio, set the 'J-Link > J-Link DLL File' target property to point to the libjlinkarm.4.dylib file you installed in step 1.
-
If you are using brew (http://mxcl.github.com/homebrew/) the command to compile universal is "brew install --universal libusb" and the library is then normally installed in /usr/local/Cellar/libusb/VERSION/lib/ where VERSION currently is 1.0.9.
-
Attached is a AppleScript app to run Terminal and enter the two commands above. Just a simple convenience so it can be put in your dock.
Script:
tell application "Terminal"
activate
my execCmd("export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH", 1)
my execCmd("'/Applications/CrossWorks for ARM 2.3/CrossStudio for ARM 2.3.app/Contents/MacOS/crossstudio'", 0)
end tell
on execCmd(cmd, wait)
tell application "System Events"
tell application process "Terminal"
set frontmost to true
keystroke cmd
keystroke return
end tell
end tell
delay wait
end execCmd
-
Rajesh, did you get it working? It sounds like your
export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH
may not have worked.
You must have your default shell set to bash for the export to work (set this by System Preferences -> Users & Groups -> make sure you are unlocked -> right click on yourself -> Advanced Options -> Login Shell)
Please sign in to leave a comment.
Comments
5 comments