[add] stlinkv1_macosx_driver from marco.cassinerio@gmail.com
authorFabien Le Mentec <texane@gmail.com>
Fri, 16 Dec 2011 20:07:17 +0000 (14:07 -0600)
committerFabien Le Mentec <texane@gmail.com>
Fri, 16 Dec 2011 20:07:17 +0000 (14:07 -0600)
stlinkv1_macosx_driver/Makefile [new file with mode: 0644]
stlinkv1_macosx_driver/README [new file with mode: 0644]
stlinkv1_macosx_driver/osx.tar.gz [new file with mode: 0644]

diff --git a/stlinkv1_macosx_driver/Makefile b/stlinkv1_macosx_driver/Makefile
new file mode 100644 (file)
index 0000000..9947ff6
--- /dev/null
@@ -0,0 +1,57 @@
+# make ... for both stlink v1 and stlink v2 support
+##
+VPATH=src
+
+SOURCES_LIB=stlink-common.c stlink-usb.c stlink-sg.c uglylogging.c
+OBJS_LIB=$(SOURCES_LIB:.c=.o)
+TEST_PROGRAMS=test_usb test_sg
+LDFLAGS=-L. -lstlink -lusb-1.0
+
+CFLAGS+=-g
+CFLAGS+=-DDEBUG=1
+CFLAGS+=-std=gnu99
+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)"
+
+osx_stlink_shield:
+       ./osx/install.sh
+
+.PHONY: clean all flash gdbserver
diff --git a/stlinkv1_macosx_driver/README b/stlinkv1_macosx_driver/README
new file mode 100644 (file)
index 0000000..23bbd86
--- /dev/null
@@ -0,0 +1,23 @@
+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.
+
+To install the driver the user have only to do:
+
+sudo make osx_stlink_shield
+
+no reboot required.
\ No newline at end of file
diff --git a/stlinkv1_macosx_driver/osx.tar.gz b/stlinkv1_macosx_driver/osx.tar.gz
new file mode 100644 (file)
index 0000000..6e7bb27
Binary files /dev/null and b/stlinkv1_macosx_driver/osx.tar.gz differ