Page 2 of 5

Re: How to compile the firmware

Posted: Sat Apr 08, 2017 12:46 am
by AndreyB
Starting with ChibiOS3 we now use submodules - already got one confused user. This is mentioned on the bottom of readme.md, on the bottom on https://github.com/rusefi/rusefi/

Code: Select all

git submodule update --init

Re: How to compile the firmware

Posted: Wed May 03, 2017 3:44 pm
by filip5
Hi there,
I am trying to get this project going in Eclipse environment. I can not get it to run due to an error 127.
Thanks for the help.

Re: How to compile the firmware

Posted: Wed May 03, 2017 3:45 pm
by AndreyB
First troubleshooting step
arm-none-eabi-gcc -v
in command prompt, what does it show?

I believe your Eclipse does not see arm-none-eabi-gcc installed

Re: How to compile the firmware

Posted: Wed May 03, 2017 3:59 pm
by filip5
it shows this:
DI Main@DIMain-PC ~
$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=C:\Program Files\GNU Tools ARM Embedded\6 2017-q1-update\bin\arm-none-eabi-gcc.exe
COLLECT_LTO_WRAPPER=c:/program\ files/gnu\ tools\ arm\ embedded/6\ 2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/src/gcc/configure --build=x86_64-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw --libexecdir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw/lib --infodir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-mingw-wildcard --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-mingw/arm-none-eabi --with-libiconv-prefix=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-mingw/host-libs/usr --with-gmp=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-mingw/host-libs/usr --with-mpfr=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-mingw/host-libs/usr --with-mpc=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-mingw/host-libs/usr --with-isl=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-mingw/host-libs/usr --with-libelf=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-mingw/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors 6-2017-q1-update' --with-multilib-list=rmprofile
Thread model: single
gcc version 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512] (GNU Tools for ARM Embedded Processors 6-2017-q1-update)

DI Main@DIMain-PC ~
$

Re: How to compile the firmware

Posted: Wed May 03, 2017 4:00 pm
by filip5
what is the command for make? I have the folder called stuff under C drive as well.

I can still not compile rusefi using arm GCC compiler.

Re: How to compile the firmware

Posted: Wed May 03, 2017 4:02 pm
by puff
I guess it has to deal with the settings of that eclipse thing.
It looks like your terminal doesn know arm-none-eabi-gcc, while the eclipe doesn't...

Re: How to compile the firmware

Posted: Wed May 03, 2017 10:10 pm
by AndreyB
puff wrote:It looks like your terminal doesn know arm-none-eabi-gcc, while the eclipe doesn't...
Exactly, looks like arm-none-eabi-gcc is installed by Eclipse cannot find it? Have you restarted Eclipse since installing arm-none-eabi-gcc?

Please type make inside firmware folder, what would it output?

Re: How to compile the firmware

Posted: Thu May 04, 2017 12:46 pm
by mobyfab
Check your PATH, restart windows if you just installed GCC.

Re: How to compile the firmware

Posted: Tue May 23, 2017 11:58 am
by megatroneye
Hi,

I've finally managed to set up my Eclipse CDT and GNU ARM Eclipse plug-in so that the firmware has at last compiled fine, but it has not been a trivial task.

There were fare more steps and tricks involved than what is described on the first, sticky post of this thread.

Maybe it's time to update that sticky post with important info? Not with much info, but at least it would be fine to mention the following:

1) Make sure the project you import/create is the right type (mine turned to be "C/C++ Project"). That's not obvious because you have a lot of ARM-typed projects to choose from.
2) Set up your project's toolchain type at: "Project properties -> C/C++ Build -> Current toolchain:". I choose "Cross ARM gcc" there.
3) Configure the toolchain itself at the global level or at your project level: "Project properties -> C/C++ Build -> Settings/Toolchains tab". Input your path to the external GNU ARM distribution's "bin" folder; for example: "D:\dev\gcc-arm-5.4\bin".

It would be nice also to mention that the Chibios3 and Chibios-contrib modules are necessary parts of the source (for the source to compile), but perhaps this info might better go to the README.MD.

D.

Re: How to compile the firmware

Posted: Tue May 23, 2017 12:11 pm
by AndreyB
megatroneye wrote:perhaps this info might better go to the README.MD
And this info is actually at the bottom of https://github.com/rusefi/rusefi/blob/master/README.md

Re: How to compile the firmware

Posted: Tue May 23, 2017 2:05 pm
by megatroneye
russian wrote:
megatroneye wrote:perhaps this info might better go to the README.MD
And this info is actually at the bottom of https://github.com/rusefi/rusefi/blob/master/README.md
You are right. Anyway, I humbly think that the tips about configuring Eclipse might help other people if they were on the sticky post.

Re: How to compile the firmware

Posted: Tue May 23, 2017 2:21 pm
by AndreyB
Technically Eclipse is optional - as long as you have compiler & make, you can use any editor. Also my assumption would be that compiler is added into PATH in which case you do not need steps #2 and #3 in my experience.

Re: How to compile the firmware

Posted: Tue May 23, 2017 2:26 pm
by megatroneye
russian wrote:Technically Eclipse is optional - as long as you have compiler & make, you can use any editor. Also my assumption would be that compiler is added into PATH in which case you do not need steps #2 and #3 in my experience.
OK then.

Re: How to compile the firmware

Posted: Tue May 23, 2017 2:27 pm
by puff
What about the makefile? andreika mentioned some sort of optimizations (or, better to say, the absense of optimizations), which caused some problems. As far as I understood, he was compiling the usual firmware with the usual Makefile? In other words, what is needed to compile the firmware as if it is compiled by the buildserver?

Re: How to compile the firmware

Posted: Tue May 23, 2017 4:03 pm
by kb1gtt
I think that it would be much easier if we used ChibiOS Studio. That is much easier to install, and offers potential debugging tools that are not currently used. Has anyone attempted to compile with a ChibiOS Studio platform? Is it a hard change? I suspect the key difference is that the underlying compiler will likely produce slightly different hex files.

Re: How to compile the firmware

Posted: Tue May 23, 2017 5:21 pm
by megatroneye
kb1gtt wrote:I think that it would be much easier if we used ChibiOS Studio. That is much easier to install, and offers potential debugging tools that are not currently used. Has anyone attempted to compile with a ChibiOS Studio platform? Is it a hard change? I suspect the key difference is that the underlying compiler will likely produce slightly different hex files.
I don't want to take part in the discussion because as a contributor-wannabe I don't regard myself as entitled to ;) , but as a matter of fact - with the help of a step-by-step guide, configuring Eclipse CDT/GNU ARM plugin to compile the firmware would not really be hard. A matter of 30 minutes-1 hour starting from zero, in my opinion.

On the other hand, it might be the case that ChibiOS studio offers other advantages beyond ease of configuration.

After downloading RusEFI's code, I decided to stick to Eclipse CDT just because I have to use several Eclipses on my everyday life and I tend to prefer the "one platform, many plugins" approach rather than downloading specific distributions for specific environments/tasks.

But I am just saying... 8-)

Re: How to compile the firmware

Posted: Tue May 23, 2017 7:45 pm
by andreika
BTW, here's a little hint if you're using MinGW-make for Windows. It may take a lot of time to start compilation due to many built-in rules (non-existent files access etc.). To disable it, start make with "-r" option:

Code: Select all

make -r
It will run much faster under Windows.

Re: How to compile the firmware

Posted: Tue May 23, 2017 8:17 pm
by kb1gtt
ChibiOS Studio is a pre-packaged eclipse environment with compiler. I agree a good wiki page or set of instructions in on place with other links pointing to that one good source is a good approach. The setup time is not long and is not hard. We could be helped with better documentation though.

Re: How to compile the firmware

Posted: Tue Aug 15, 2017 9:25 pm
by hossein
Hi, i was trying to compile the latest firmware two hours before, and i got the issue now:

Code: Select all

Compiling rusefi.cpp
Compiling main.cpp
Linking build/rusefi.elf
config/stm32f4ems/STM32F407xG.ld:24: nonconstant expression for origin

and the line contains :

Code: Select all

 flash : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x0800000, len = DEFINED(BOOTLOADER) ? 864k : 896k  /* change address & length if bootloader */
Is something incorrect about addressing by default or I missed ?

Thanks ;).

Re: How to compile the firmware

Posted: Tue Aug 15, 2017 9:27 pm
by AndreyB
Have not experiensed this one. What version of gcc are you using?

Re: How to compile the firmware

Posted: Tue Aug 15, 2017 9:28 pm
by hossein

Code: Select all

gcc-4.9-arm-linux-gnueabihf     4.9.2-10
gcc-4.9-base:armhf      4.9.2-10
gcc-arm-linux-gnueabihf         4.9.2-10.1
gcc-arm-none-eabi       4.8.4-1+11-1
libgcc-4.9-dev:armhf    4.9.2-10
libgcc1:armhf   1:4.9.2-10

Re: How to compile the firmware

Posted: Tue Aug 15, 2017 11:25 pm
by AndreyB
https://launchpad.net/gcc-arm-embedded seems to show 5.4 or something? Can you please try that?

I am using 5.4 from 2016q3 on my windows box

Re: How to compile the firmware

Posted: Wed Aug 16, 2017 8:40 am
by hossein
I think my session is hijacked .... :-p
Building elf is done successfully now
gcc version to support correct compile proc
gcc version to support correct compile proc
snapshot524.png (81.17 KiB) Viewed 61176 times
And now i think i might change the values in

Code: Select all

   flash : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x0800000, len = DEFINED(BOOTLOADER) ? 864k : 896k  /* change address & length if bootloader */
because of error
error because of invalid values
error because of invalid values
snapshot525.png (132.35 KiB) Viewed 61176 times

Re: How to compile the firmware

Posted: Fri Dec 14, 2018 2:14 am
by atntpt
Hi guys, I'm having difficulties with the firmware part. my English is somewhat limited and when it comes time to understand more technical things I have some difficulty.
and first of all I am not being able to compile the firmware, I think I already have everything installed. this appears"Makefile:353: ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk: No such file or directory"
then wanted to understand the part of the different configurations for the various PCBs. From what I understand it is necessary to compile the firmware for each board. right?! for example how would I compile for prometheus with the 405? or to the 469?

Re: How to compile the firmware

Posted: Fri Dec 14, 2018 2:30 am
by AndreyB
atntpt wrote:
Fri Dec 14, 2018 2:14 am
I think I already have everything installed. this appears"Makefile:353: ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk: No such file or directory"
I have two great news for you.
You are not the first one who did not read the bottom of https://github.com/rusefi/rusefi where it says

Code: Select all

We now use submodules:

git submodule update --init
And - more importantly - the Makefile will now tell you to invoke this command: https://github.com/rusefi/rusefi/commit/106d6b8b7b22e95ccfa20abd749f8505f1d54e52

Re: How to compile the firmware

Posted: Fri Dec 14, 2018 3:44 am
by atntpt
Yup missed that, did some search and was able to clone git via command line and update submodules somthing went wrong tho.. error 1..
but about the second question? is the firmware compliled for the board ? and how to select a target board to build for

Re: How to compile the firmware

Posted: Fri Dec 14, 2018 4:12 am
by AndreyB
no option -wimplicit-fallthrough means you use old version of compiler - see https://github.com/rusefi/rusefi/issues/517

Yes default files are for stm32f407 see !compile-prometheus.bat to see how different configuration is selected. I only use default stm32f407 so not the best person to consult on other boards.

Re: How to compile the firmware

Posted: Fri Dec 14, 2018 6:05 am
by andreika
russian wrote:
Fri Dec 14, 2018 4:12 am
see !compile-prometheus.bat to see how different configuration is selected.
The "!compile-prometheus.bat" is for Prometheus with 469 chip.
For 405 chip, you need to replace "-DSTM32F469xx" makefile option with "-DSTM32F405xx".

Re: How to compile the firmware

Posted: Sun Feb 10, 2019 2:59 am
by yyj876790646
I have trouble compile the firmware.I've done the git clone and git submodule update --init operation but the make4.bat didn't succeed.
My gcc version is cc version 4.7.3 20130312 (release) [ARM/embedded-4_7-branch revision 196615] (GNU Tools for ARM Embedded Processors)
C:\Users\Administrator\rusefi\firmware>make -j4
Compiling crt0_v7m.S
Compiling vectors.S
Compiling chcoreasm_v7m.S
Compiling crt1.c
cc1.exe: error: -Werror=implicit-fallthrough: no option -Wimplicit-fallthrough
cc1.exe: error: -Werror=bool-operation: no option -Wbool-operation
make: *** [ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk:253: build/obj/crt0_v7m.o] Error 1
make: *** Waiting for unfinished jobs....
cc1.exe: error: -Werror=implicit-fallthrough: no option -Wimplicit-fallthrough
cc1.exe: error: -Werror=bool-operation: no option -Wbool-operation
cc1.exe: error: -Werror=implicit-fallthrough: no option -Wimplicit-fallthrough
cc1.exe: error: -Werror=bool-operation: no option -Wbool-operation
make: *** [ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk:253: build/obj/vectors.o] Error 1
make: *** [ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk:253: build/obj/chcoreasm_v7m.o] Error 1
cc1.exe: error: -Werror=implicit-fallthrough: no option -Wimplicit-fallthrough
cc1.exe: error: -Werror=bool-operation: no option -Wbool-operation
make: *** [ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk:235: build/obj/crt1.o] Error 1

Hope someone can help me.Thanks in advance! :)

Re: How to compile the firmware

Posted: Sun Feb 10, 2019 4:08 am
by AndreyB
yyj876790646 wrote:
Sun Feb 10, 2019 2:59 am
My gcc version is cc version 4.7.3 20130312 (release) [ARM/embedded-4_7-branch revision 196615] (GNU Tools for ARM Embedded Processors)
the part about 2013 looks to be the problem. Please use current gnu arm 8 or recent gnu arm 7.3

At the moment I am using 7.3.1 20180622