Georg Icking-Konert
2015-04-19 02:15:36 UTC
hi all,
for the STM8 Discovery board I want to use Valentin's stm8flash tool (https://github.com/vdudouyt/stm8flash) for flashing via SWIM / ST-Link. This board has no UART<->USB connection and therefore cannot be programmed via UART boot loader â> need a SWIM tool
Unfortunately I wasnât able to compile the tool on my Mac. Here's my steps with observations:
installed pkg-config and libusb via Homebrew --> worked
compile of stlink.c gave
many warning messages like (ignored):
stlink.c:37:71: warning: passing 'char [32]' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
--> suppose this is not critical...? Disabled all warnings by CFLAGS += -w in Makefile
many error messages like (fixed):
/usr/local/Cellar/libusb/1.0.19/include/libusb-1.0/libusb.h:1696:10: error: use of undeclared identifier âNULL'
--> fixed by #include <stddef.h> in stlink.c before #include <libusb.h>
many error message like (open):
stlink.c:340:12: error: use of undeclared identifier âstderr'
fprintf(stderr, "Unknown status: %x\n", status);
In addition it warns that
declaration of built-in function 'fprintf' requires inclusion of the header <stdio.h>
--> it seems like the inclusion of <stdio.h> in line 4 of stlink.c has no effect... :-(
to make sure my toolchain is ok, I compiled a dummy program with fprintf(stderr,"test"); and it was ok
â> I played around a lot but can't get that stdio.h error fixed. Apparently the compiler "forgetsâ the stdio.h declarations completely and I have no clue, why⊠:-(
Hardware Setup:
iMac running MacOS X 10.10.3
"gcc -vâ yields:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
HW works under Windows on a VirtualPC, i.e. STVD could flash & debug the board on the same Mac and USB port
Anybody has idea what's going wrong, or maybe even succeeded in compiling the tool for MacOS X? For your help thanks a lot in advance!
Regards,
Georg Icking
for the STM8 Discovery board I want to use Valentin's stm8flash tool (https://github.com/vdudouyt/stm8flash) for flashing via SWIM / ST-Link. This board has no UART<->USB connection and therefore cannot be programmed via UART boot loader â> need a SWIM tool
Unfortunately I wasnât able to compile the tool on my Mac. Here's my steps with observations:
installed pkg-config and libusb via Homebrew --> worked
compile of stlink.c gave
many warning messages like (ignored):
stlink.c:37:71: warning: passing 'char [32]' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
--> suppose this is not critical...? Disabled all warnings by CFLAGS += -w in Makefile
many error messages like (fixed):
/usr/local/Cellar/libusb/1.0.19/include/libusb-1.0/libusb.h:1696:10: error: use of undeclared identifier âNULL'
--> fixed by #include <stddef.h> in stlink.c before #include <libusb.h>
many error message like (open):
stlink.c:340:12: error: use of undeclared identifier âstderr'
fprintf(stderr, "Unknown status: %x\n", status);
In addition it warns that
declaration of built-in function 'fprintf' requires inclusion of the header <stdio.h>
--> it seems like the inclusion of <stdio.h> in line 4 of stlink.c has no effect... :-(
to make sure my toolchain is ok, I compiled a dummy program with fprintf(stderr,"test"); and it was ok
â> I played around a lot but can't get that stdio.h error fixed. Apparently the compiler "forgetsâ the stdio.h declarations completely and I have no clue, why⊠:-(
Hardware Setup:
iMac running MacOS X 10.10.3
"gcc -vâ yields:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
HW works under Windows on a VirtualPC, i.e. STVD could flash & debug the board on the same Mac and USB port
Anybody has idea what's going wrong, or maybe even succeeded in compiling the tool for MacOS X? For your help thanks a lot in advance!
Regards,
Georg Icking