-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updated xcode project settings v11.3.1 - Removed support for 10.6-10.12 - Compiled new kexts for macOS 10.13-10.15 - Moved instructions to separate README - Updated installation instructions
- Loading branch information
1 parent
937f4d6
commit edc5e44
Showing
35 changed files
with
3,403 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# make ... for both stlink v1 and stlink v2 support | ||
## | ||
VPATH=src | ||
|
||
SOURCES_LIB=common.c usb.c sg.c logging.c | ||
OBJS_LIB=$(SOURCES_LIB:.c=.o) | ||
TEST_PROGRAMS=test-flash test-sg test-usb | ||
LDFLAGS=-L. -lstlink -lusb-1.0 | ||
|
||
CFLAGS+=-g | ||
CFLAGS+=-DDEBUG=1 | ||
CFLAGS+=-std=gnu11 | ||
CFLAGS+=-Wall -Wextra | ||
|
||
|
||
LIBRARY=libstlink.a | ||
|
||
all: $(LIBRARY) flash gdbserver $(TEST_PROGRAMS) | ||
|
||
$(LIBRARY): $(OBJS_LIB) | ||
@echo "objs are $(OBJS_LIB)" | ||
$(AR) -cr $@ $^ | ||
@echo "done making library" | ||
|
||
|
||
test_sg: test_sg.o $(LIBRARY) | ||
@echo "building test_sg" | ||
$(CC) test_sg.o $(LDFLAGS) -o $@ | ||
|
||
test_usb: test_usb.o $(LIBRARY) | ||
@echo "building test_usb" | ||
$(CC) test_usb.o $(LDFLAGS) -o $@ | ||
@echo "done linking" | ||
|
||
%.o: %.c | ||
@echo "building $^ into $@" | ||
$(CC) $(CFLAGS) -c $^ -o $@ | ||
@echo "done compiling" | ||
|
||
clean: | ||
rm -rf $(OBJS_LIB) | ||
rm -rf $(LIBRARY) | ||
rm -rf test_usb* | ||
rm -rf test_sg* | ||
$(MAKE) -C flash clean | ||
$(MAKE) -C gdbserver clean | ||
|
||
flash: | ||
$(MAKE) -C flash | ||
|
||
gdbserver: | ||
$(MAKE) -C gdbserver CONFIG_USE_LIBSG="$(CONFIG_USE_LIBSG)" | ||
|
||
macos_stlink_shield: | ||
./install.sh | ||
|
||
.PHONY: clean all flash gdbserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from: marco.cassinerio@gmail.com | ||
|
||
to: texane@gmail.com | ||
|
||
Hi, | ||
|
||
I managed to get the stlink v1 working under os x and i would like to share the solution so maybe you can add it in your package. The problem is that os x claims the device as scsi and libusb won't be able to connect to it. | ||
I've created what is called a codeless driver which claims the device and has a higher priority then the default apple mass storage driver, so the device can be accessed through libusb. I tested this codeless driver under OS X 10.6.8 and 10.7.2. | ||
I assume it works with any 10.6.x and 10.7.x version as well. Attached to this mail you'll find the osx folder with the source code of the driver, both drivers (for 10.6.x and 10.7.x), an install.sh script and the modified Makefile, i only added a line at the end which invoke the `install.sh`. | ||
|
||
First, unpack the `osx.tar.gz` contents: | ||
```bash | ||
tar xzvf osx.tar.gz | ||
``` | ||
|
||
Then, install the driver using: | ||
```bash | ||
sudo make osx_stlink_shield | ||
``` | ||
|
||
no reboot required. | ||
|
||
P.S. If error `OS X version not supported` occurs. For the latest versions of Mac OS X you may need to change the `osx/install.sh` as follows: | ||
```bash | ||
< ISOSXLION=$(sw_vers -productVersion) | ||
--- | ||
> ISOSXLION=$(sw_vers -productVersion | sed -e 's:.[[:digit:]]*$::') | ||
``` | ||
|
||
### OS X 10.10 Yosemite | ||
|
||
For OS X 10.10 Yosemite you must force the system to load unsigned kernelextensions | ||
|
||
```bash | ||
sudo nvram boot-args="kext-dev-mode=1" | ||
``` | ||
|
||
reboot the system! | ||
|
||
### OS X 10.11 El Capitan | ||
|
||
For OS X 10.11 El Capitan: the Yosemite kext seems to work (tested on 10.11.04). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
ISMACOS=$(sw_vers -productVersion | sed -e 's:.[[:digit:]]*$::') | ||
case $ISMACOS in | ||
10.13) | ||
KEXT="stlink_shield10_13.kext" | ||
;; | ||
10.14) | ||
KEXT="stlink_shield10_14.kext" | ||
;; | ||
10.15) | ||
KEXT="stlink_shield10_15.kext" | ||
;; | ||
*) | ||
echo "OS X version not supported." | ||
exit 1 | ||
;; | ||
esac | ||
chown -R root:wheel $KEXT/ | ||
cp -R $KEXT /System/Library/Extensions/stlink_shield.kext | ||
kextload -v /System/Library/Extensions/stlink_shield.kext | ||
touch /System/Library/Extensions |
82 changes: 82 additions & 0 deletions
82
stlinkv1_macos_driver/stlink_shield_10.13.kext/Contents/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildMachineOSBuild</key> | ||
<string>18G4032</string> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.libusb.stlink-shield</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>KEXT</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleSupportedPlatforms</key> | ||
<array> | ||
<string>MacOSX</string> | ||
</array> | ||
<key>CFBundleVersion</key> | ||
<string>1.0.0</string> | ||
<key>DTCompiler</key> | ||
<string>com.apple.compilers.llvm.clang.1_0</string> | ||
<key>DTPlatformBuild</key> | ||
<string>11C504</string> | ||
<key>DTPlatformVersion</key> | ||
<string>GM</string> | ||
<key>DTSDKBuild</key> | ||
<string>19B90</string> | ||
<key>DTSDKName</key> | ||
<string>macosx10.15</string> | ||
<key>DTXcode</key> | ||
<string>1130</string> | ||
<key>DTXcodeBuild</key> | ||
<string>11C504</string> | ||
<key>IOKitPersonalities</key> | ||
<dict> | ||
<key>DeviceDriver</key> | ||
<dict> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.apple.kpi.iokit</string> | ||
<key>IOClass</key> | ||
<string>IOService</string> | ||
<key>IOProviderClass</key> | ||
<string>IOUSBDevice</string> | ||
<key>bcdDevice</key> | ||
<integer>256</integer> | ||
<key>idProduct</key> | ||
<integer>14148</integer> | ||
<key>idVendor</key> | ||
<integer>1155</integer> | ||
</dict> | ||
<key>InterfaceDriver</key> | ||
<dict> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.apple.kpi.iokit</string> | ||
<key>IOClass</key> | ||
<string>IOService</string> | ||
<key>IOProviderClass</key> | ||
<string>IOUSBInterface</string> | ||
<key>bConfigurationValue</key> | ||
<integer>1</integer> | ||
<key>bInterfaceNumber</key> | ||
<integer>0</integer> | ||
<key>idProduct</key> | ||
<integer>14148</integer> | ||
<key>idVendor</key> | ||
<integer>1155</integer> | ||
</dict> | ||
</dict> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.13</string> | ||
<key>OSBundleLibraries</key> | ||
<dict> | ||
<key>com.apple.iokit.IOUSBFamily</key> | ||
<string>1.8</string> | ||
<key>com.apple.kpi.libkern</key> | ||
<string>11.2.0</string> | ||
</dict> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+33 KB
stlinkv1_macos_driver/stlink_shield_10.13.kext/Contents/MacOS/stlink_shield_10.13
Binary file not shown.
1 change: 1 addition & 0 deletions
1
stlinkv1_macos_driver/stlink_shield_10.13.kext/Contents/PkgInfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KEXT???? |
115 changes: 115 additions & 0 deletions
115
stlinkv1_macos_driver/stlink_shield_10.13.kext/Contents/_CodeSignature/CodeResources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>files</key> | ||
<dict/> | ||
<key>files2</key> | ||
<dict/> | ||
<key>rules</key> | ||
<dict> | ||
<key>^Resources/</key> | ||
<true/> | ||
<key>^Resources/.*\.lproj/</key> | ||
<dict> | ||
<key>optional</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1000</real> | ||
</dict> | ||
<key>^Resources/.*\.lproj/locversion.plist$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1100</real> | ||
</dict> | ||
<key>^Resources/Base\.lproj/</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>1010</real> | ||
</dict> | ||
<key>^version.plist$</key> | ||
<true/> | ||
</dict> | ||
<key>rules2</key> | ||
<dict> | ||
<key>.*\.dSYM($|/)</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>11</real> | ||
</dict> | ||
<key>^(.*/)?\.DS_Store$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>2000</real> | ||
</dict> | ||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key> | ||
<dict> | ||
<key>nested</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>10</real> | ||
</dict> | ||
<key>^.*</key> | ||
<true/> | ||
<key>^Info\.plist$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^PkgInfo$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^Resources/</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^Resources/.*\.lproj/</key> | ||
<dict> | ||
<key>optional</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1000</real> | ||
</dict> | ||
<key>^Resources/.*\.lproj/locversion.plist$</key> | ||
<dict> | ||
<key>omit</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>1100</real> | ||
</dict> | ||
<key>^Resources/Base\.lproj/</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>1010</real> | ||
</dict> | ||
<key>^[^/]+$</key> | ||
<dict> | ||
<key>nested</key> | ||
<true/> | ||
<key>weight</key> | ||
<real>10</real> | ||
</dict> | ||
<key>^embedded\.provisionprofile$</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
<key>^version\.plist$</key> | ||
<dict> | ||
<key>weight</key> | ||
<real>20</real> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
Oops, something went wrong.