Compiling VESC firmware on Windows

General topics and discussions about the VESC and its development.
pf26
Posts: 294
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Compiling VESC firmware on Windows

Postby pf26 » 28 Mar 2016, 14:53

Hi,
I'd like to test some changes in VESC firmware, and it is easier for me to stay under Windows XP.
I installed an IDE (emIDE), GCC arm toolchain and GNU make.
I had to change some details in some .mk file (replace "shell cat".. by "cat") otherwise, it would generate errors.
But still, invoquing make.exe upload will not compile :
-------------- Build: Debug in vesc1 (compiler: GNU ARM GCC Compiler)---------------
Running command: make.exe upload
make.exe: *** No rule to make target `build/BLDC_4_ChibiOS.elf', needed by `build/BLDC_4_ChibiOS.bin'. Stop.

Did someone manage to compile the VESC firmware under Windows ?
Possibly there are some issues with incompatible filenames, case sensitivity, "/" and "\" in paths, too long path ??

Thks,

rew
Posts: 937
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Compiling VESC firmware on Windows

Postby rew » 28 Mar 2016, 21:05

Does it start compiling or is this the first message you get?

pf26
Posts: 294
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Compiling VESC firmware on Windows

Postby pf26 » 29 Mar 2016, 06:35

This is the first and only message I get.

rew
Posts: 937
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Compiling VESC firmware on Windows

Postby rew » 30 Mar 2016, 12:32

As you see in the makefile, around line 267, the ".bin" should be generated from teh ".elf". That section explains to make how to do that.

In the chibios sources, the rest, including "how to build the .elf" is being "explained to make". On my system that works. I suggest you would need to do some debugging. Does the last line of the makefile work? Which file does it include? What does it say?

pf26
Posts: 294
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Compiling VESC firmware on Windows

Postby pf26 » 30 Mar 2016, 15:13

The last line of the makefile is: include $(RULESPATH)/rules.mk
If I add a syntax error in this rules.mk file, then the build process shows the syntax error and stops. So I assume this file is properly used during make.

This rules.mk seem to have many rules, and the one corresponding to .elf files seems to be here :
%.elf: $(OBJS) $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
else
@echo Linking $@
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
endif
Surprising thing is I have no echo of @echo commands, whatever I put after the @echo..

rew
Posts: 937
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Compiling VESC firmware on Windows

Postby rew » 31 Mar 2016, 08:24

Make is telling you that somehow it didn't manage to find that rule. It says; No rule to make .elf!
So that rule is not executing. Not because of anything IN the rule, but because it didn't find THAT rule.

For your convenience I added echo BLALBLA on line 234 of the rules.mk file and when I type make MY make does find and executes the .elf rule.

So somehow your Make thinks that the rule does not apply.

You could simplify things by changing:

Code: Select all

%.elf: $(OBJS) $(LDSCRIPT)
        echo BLALBLA
ifeq ($(USE_VERBOSE_COMPILE),yes)
        @echo
        $(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
else
        @echo Linking $@
        @$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@


to:

Code: Select all

build/BLDC_4_ChibiOS.elf: $(OBJS) $(LDSCRIPT)
        $(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@^M

On second thought. Just leave the original in place and just add the two lines I suggested.

MMichi
Posts: 7
Joined: 10 Mar 2016, 15:41
Location: Deutschland

Re: Compiling VESC firmware on Windows

Postby MMichi » 31 Mar 2016, 13:34

I have build it using Embitz. Additional software you need is msys1.0 (or something simmilar which provides Make,cat,egrep etc...) nothing else.
You don't need to fiddel around with the Makefile. It just builds it, but building is slow like using Eclipse :( Debugging and uploading to target works with the usal Embitz speed. Mouseover, live variables, cpu registers is working.

pf26
Posts: 294
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Compiling VESC firmware on Windows

Postby pf26 » 31 Mar 2016, 15:11

Thks for your input. I installed msys1.0? I configured my EmIDE use the "make.exe" file from the msys bin directory (in settings/compiler/toolchain executables)
But still, error : 'egrep' is not recognized as an internal or external command or program (the error was mentioned in my Windows langage)
I have added a path variable to reach all .exe files from msys bin folder (there is no egrep.exe file, just a grep.exe or grep in this folder)

I no longer get the error from "shell cat" - I formerly had to replace with "cat"
Do you think I need to install Embitz instead EmIDE ?
Sorry for so stupid questions, I have very little idea of what I am doing there, it is very unconfortable for me.

rew
Posts: 937
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Compiling VESC firmware on Windows

Postby rew » 31 Mar 2016, 16:02

It is looking for the egrep binary. If that is not available, grep is an alternative. Just copy the grep binary over, or find the spot where egrep is mentioned in the makefile.

pf26
Posts: 294
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Compiling VESC firmware on Windows

Postby pf26 » 31 Mar 2016, 19:11

I think there is something wrong with the shell configuration in EmIDE. In general settings, there is an option saying "Shell to run commands in", and a textbox with a containing a path which in not correct but grayed out, so I cannot change it..


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests