I followed the (not so clear at times) instructions on installing the local toolchain and repositories in a Windows (8.1 in my case) environment. The paths are set correctly and the tools run just fine but I believe the makefiles will not work in windows. First, the rm and mkdir commands have command line arguments not compatible with the Windows version. Second, the rm and mkdir commands will not run correctly in windows due to the “/” versus “” problem. I edited the makefiles and made changes as follows:
rm = del
mkdir = mkdir
So when I run make as instructed, I get:
E:\SparkChain\core-firmware\build>make
Building core-common-lib
Building file: ../CC3000_Host_Driver/cc3000_common.c
Invoking: ARM GCC C Compiler
mkdir obj/CC3000_Host_Driver/
The syntax of the command is incorrect.
make[1]: *** [obj/CC3000_Host_Driver/cc3000_common.o] Error 1
make: *** [check_external_deps] Error 2
E:\SparkChain\core-firmware\build>
Make cannot create the necessary directories. First, because Windows mkdir cannot create the entire path in one command. Second because the “/” syntax is wrong. Obviously, the version of MAKE is for Windows so there has to be a way for this to work. Perhaps the makefiles need to be changed to work in Windows?
Is there a gnuWin32 or other version of mkdir that works as expected?
[UPDATE] The Windows version git installed as part of the toolchain has version of rm and mkdir that can be specified in the makefiles. I edited the makefile in each of the three repositories and changed the rm and mkdir entries as follows:
When I ran make from the core-firmware/build directory again, it worked perfectly with no errors. Perhaps this information should be included in your toolchain instructions!
If you install GitHub for Windows, Git-aware shells are pre-configured on your system. In the GitHub Windows app, select tools, then Options… to define the default shell, which can be Cmd, Git Bash, PowerShell or Custom.
To start a Git-aware shell, press the Windows key and type “git” and select Git Shell. Now when you use commands like RM and MKDIR, they “just work”.
I have been running into the same problem and when I followed https://community.spark.io/t/how-to-video-for-compiling-locally-in-windows/2457 I encountered the problem in net beans. Once in ensured that make and net beans ran with elevated privileges everything worked perfectly. If you are in Windows, it is important to run with Administrator privileges if you doing things from a standard user account.
Hi @nitred - just a tip on using the makefile on Windows. It’s best to install mingw and the msys and have both in the path. Then mkdir/rm etc… works without needing to modify the makefile.
You can either set this up in your system path, or have a small batch script do it. (I use the same script to also setup the environment before launching netbeans.)
@naikrovek, I was not trying to make things more difficult. The reality is that as Spark evolves quickly so do affected systems. When I posted that the information was old it is because of large changes to the local toolchain make files that I had not come up to speed with. I have since figured it out and I will post the latest method.
I don’t know why you say it is difficult to compile in Windows however. I have the local toolchain working on both Windows 7 and 8.1 without any issues. The trick is installing the necessary support tools like gcc. I also have Spark CLI and DEV working just fine without any issues either. However, I DO NOT use an environment like Eclipse or Netbeans. Those are well documented in other topics.
I’ll try and post the “latest” instructions later today.
Thanks. Sorry to be a pain. I just HATE C with a passion and these little issues don’t help me much.
Yah, and don’t do it just for me. I just won’t have a local build environment, that’s ok. I dislike C and I’m pretty sure that the people who like C are fully capable of setting up their own environments without help.
These changes point to the MAKE compatible programs (rm.exe and mkdir.exe) exec files in the Git BIN directory. If everything went well, running "make" from the core-firmware\build directory should build the default Tinker app (and firmware).
I found that I didn’t have to modify the makefile if I used the Git Shell that comes with GitHub for Windows. In fact, I’m pretty sure I didn’t have to modify anything. Just downloading make, the ARM GCC and some supporting DLLs for make then adding it all to my path was enough.
Compiled and flashed the core from the command line in less than a minute, more or less. Very nice experience.
I have just installed the toolchain on a new windows 7 PC using all the latest files from the git. I used @mdma 's version of dfu-util as the link in the spark/firmware GitHub is broken.
I get the expected error (that I didn’t get with my old version of the tool chain) when using the windows terminal.
E:\>cd Spark\core-firmware\build
E:\Spark\core-firmware\build>make
Building core-common-lib
Building file: ../CC3000_Host_Driver/cc3000_common.c
Invoking: ARM GCC C Compiler
mkdir -p obj/CC3000_Host_Driver/
The syntax of the command is incorrect.
make[1]: *** [obj/CC3000_Host_Driver/cc3000_common.o] Error 1
make: *** [check_external_deps] Error 2
When I use Git Bash I get
Pete@Media-PC ~
$ cd /e/Spark/core-firmware/build
$ make
sh: C:\Program: No such file or directory
make: *** [check_external_deps] Error 127
@naikrovek where did you put your various files? Did any of the directories have spaces in the directory name? I think I have the correct path settings and can see them both in Windows and Git bash.