We need a toolchain and library.... (problem on Windows 10)
Following the instructions I'm unable to install a working toolchain on W10.
I have these installs:
gcc version: 5.4.1 20160919
make version: GNU Make 3.81
environment var LIBOPEN_CM3 pointing to libopencm3 library
running make gives following errors:
Any ideas ?
D:\data\myf103apps\blink>make V=1 Access denied - . File not found - -NAME Using D:\data\libopencm3 path to library LD blink.elf arm-none-eabi-gcc --static -nostartfiles -T../stm32f103.ld -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd -Wl,-Map=blink.map -Wl,--gc-sections -LD:\data\libopencm3/lib blink.o -lopencm3_stm32f1 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o blink.elf d:/exe/gnu_tools_arm_embedded/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: cannot open linker script file libopencm3_stm32f1.ld: No such file or directory collect2.exe: error: ld returned 1 exit status make: *** [blink.elf] Error 1
Hm - I don't use Windows, so I'll be mostly guessing...
Can you show the output of "make -n"?
I'm guessing that the "-NAME" error could have something to do with this line in
STYLECHECKFILES := $(shell find . -name '*.[ch]')
If nothing else comes up, you could try building one of the examples in the
Edit: is the reported location of libopencm3 correct?
make -n reports:
D:\data\myf103apps\blink>make -n Access denied - . File not found - -NAME printf " CC blink.c\n" arm-none-eabi-gcc -Os -std=c99 -g -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd -Wextra -Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -fno-common -ffunction-sections -fdata-sections -MD -Wall -Wundef -DSTM32F1 -ID:\data\libopencm3/include -o blink.o -c blink.c printf " LD blink.elf\n" arm-none-eabi-gcc --static -nostartfiles -T../stm32f103.ld -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd -Wl,-Map=blink.map -Wl,--gc-sections -LD:\data\libopencm3/lib blink.o -lopencm3_stm32f1 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o blink.elf printf " OBJCOPY blink.bin\n" arm-none-eabi-objcopy -Obinary blink.elf blink.bin
and the reported location of libopencm3 indeed is the rootdir of this library.
I was hoping there is an obvious reason for this error. For a 'toolchain'-newby like me all these settings are very overwhelming.
This very much points to that
STYLECHECKFILES line being related to this problem. It's called before
make starts processing the individual rules.
Do you have the
find tool installed? Is it part of cygwin or something? It's been a long time since I've worked on Windows - I'm hoping that someone more in the know can help here.
BTW, if this is indeed the problem, then it's really a libopencm3 issue - might be an idea to ask about this on their mailing list, IRC, or Gitter.
I think the toolchain now is working fine on Windows 10. But it took quit some more steps before it works.
If there is more interest, I can make a step-by-step plan for W10
There are not troubles inside Bash for Ubuntu for Windows https://msdn.microsoft.com/en-us/commandline/wsl/about
You can use https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa directly there
Thxs for this pointer. I'll have a look at it!
I'm seeing a similar issue on a mac... any pointers?
/Users/Dillon/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: cannot open linker script file libopencm3_stm32f1.ld: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [blink.elf] Error 1
You can try mbed cli as wrapper for git/hg, gcc, ... - unified toolchain environment for Windows, Linux and Mac OS X
BTW it has nice library manager
Thanks michalm. Can you give me an example of how I could use this to assist me with my current issue? This tool looks very powerful, but also seems to have a steep learning curve.
The problem was that I didn't
make the libopencm3 after downloading. It wasn't explicitly stated in the article, but I found it on the GitHub for that project.
Ah, thanks for catching that - I've been bitten by this as well, but had forgotten all about it. I'll update the article.
I have proposed to build the library and add the STM32L0 specific lib .a to the embello repository.
Saves others from trying to figure out how to build libopencm3.
Header files also need to be included. I do not know whether that will become a license issue.
I went through an effort to merge pull request on libopencm3 to my fork of libopencm3. That pull request included usart, i2c and usb drivers for the STM32 L0 series used in the JeeNode Zero.
I have extended that with a still missing SPI driver. I have a pre-built version of the L0-capable version of libopencm3.
I have created several makefile projects for the JNZv3 demonstrating the use of the drivers. The examples can be found in my github embapps repository, in the jnz folder. https://github.com/SevenW/embapps/tree/master/jnz
This includes the pre-built libopencm3, and all of the makefiles are tuned to find this library. I did this, because it is nowhere else available with the L0 goodies.
The examples apps can be imported on Windows in Eclipse as make file projects.
To be able to use eclipse, toolchains need to be installed, for ARM compiler, make utility and other utilities that implement common linux commands on windows. What I do is adding the PATH's to those three different things to my system path. As a result, eclipse can always find the ARM cross-compiler and make utility. The advantage is that one has to make no special settings per project anymore.
On request, I could make a step-by-step description of setting up the windows build environment with eclipse and toolchains, and a getting started with the embapps examples.