[info] How to compile the firmware

It's all about the code!
mck1117
running engine in first post
running engine in first post
Posts: 1275
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: How to compile the firmware

Post by mck1117 »

puff wrote:
Fri Jun 26, 2020 8:41 am
as far as I remember, git clone takes up too much space and network traffic, downloading unnecessary hardware-related files, datasheets, etc. I don't remember if I managed to find a solution to download it partially ;-(
... are you cloning every single time? You just need to

Code: Select all

git pull
to update to latest.
petersma
Posts: 12
Joined: Wed Jun 17, 2020 12:54 pm

Re: How to compile the firmware

Post by petersma »

Thanks,
you are right that my style downloads all files and this is only simple and ugly way to do it. My style is KISS (Keep It Simple Stubid).

I have done it once. I'm not good using git. My biggest problem is that my chinese STM32F407VGT6 board don't run this code. I'm searching the problem, and reason compiling firmware is only test, that I have all files ok. If I find the problem, I must compile it with my modifications. While my modification are not ready, I have no reason to download code again. Maybe I must do it never.
To recompile project I need only 'make clean' or 'make'. Maybe I made project to Eclipse and compile it pressing button. This is also good way to debug code.

All says that buy STM32F4-DISCOVERY board. They are simply right, but I don't do so. It's my hoppy to find problem and fix it. I leaning a lot with it.

My problem is this: https://rusefi.com/forum/viewtopic.php?f=2&t=1778
User avatar
AndreyB
Site Admin
Posts: 12802
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: How to compile the firmware

Post by AndreyB »

70% of the content in the post above should not be in this topic. Please stay on-topic.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
SlowRiot
Posts: 15
Joined: Fri Feb 26, 2021 2:28 am
Location: UK
Github Username: SlowRiot

Re: How to compile the firmware

Post by SlowRiot »

petersma wrote:
Fri Jun 26, 2020 1:40 am
The Linux way!

...
Building on Linux, it's sufficient to do:

Code: Select all

git clone --recursive https://github.com/rusefi/rusefi.git
cd rusefi/firmware
make -j $(nproc)
Recursive clone fetches all submodules and make builds in parallel with a number of threads suited to your CPU.
puff
contributor
contributor
Posts: 2923
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: How to compile the firmware

Post by puff »

This will make the local copy of the whole bunch of not needed stuff - hardware files, etc. That's a pity there is still no known way to copy just the source files required for firmware build.
mck1117
running engine in first post
running engine in first post
Posts: 1275
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: How to compile the firmware

Post by mck1117 »

puff wrote:
Fri Mar 05, 2021 9:53 pm
This will make the local copy of the whole bunch of not needed stuff - hardware files, etc. That's a pity there is still no known way to copy just the source files required for firmware build.
Meh, storage is cheap. A full clone is only ~4 gig. A lot of that is the submodule for the MCU definition files for debugging which are extremely compressed, so the download is far smaller than 4 gig.
dbh97
contributor
contributor
Posts: 82
Joined: Sat Jul 19, 2014 10:43 pm
Location: 67867
Github Username: chuckwagoncomputing
Slack: dbh97

Re: How to compile the firmware

Post by dbh97 »

I haven't tried it, but

Code: Select all

--depth 1
should reduce the download size.
puff
contributor
contributor
Posts: 2923
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: How to compile the firmware

Post by puff »

Boostonabudget
Posts: 51
Joined: Thu Feb 27, 2020 1:15 am
Slack: Callum Henn***

Re: How to compile the firmware

Post by Boostonabudget »

Having some issues getting anything to build firmware. Have Chibistudio installed with gnu gcc arm and everything I was told to get along with adding plenty of path directories. Not sure what's wrong and haven't deal much with these before so help would be very much appreciated

This is the error I get everytime:

Makefile:171: ../ChibiOS/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk: such file or directory
make: *** No rule to make target '../ChibiOS/os/common/startup/ARMCMx/compileGCC/mk/rules.mk'. Stop.
./build_bootloader.sh: line 8: arm-none-eabi-objcopy: command not found
./build_bootloader.sh: line 10: arm-none-eabi-objcopy: command not found
rm: cannot remove 'build/': No such file or directory
Makefile:187: ChibiOS/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk: No h file or directory
make: *** No rule to make target 'ChibiOS/os/common/startup/ARMCMx/compilers//mk/rules.mk'. Stop.
dd: failed to open 'build/wideband.bin': No such file or directory
./build_wideband.sh: line 19: arm-none-eabi-objcopy: command not found
./build_wideband.sh: line 22: crc32: command not found
./build_wideband.sh: line 22: build/wideband_crc.bin: No such file or directo
./build_wideband.sh: line 25: build/wideband_image.bin: No such file or direcy
cat: bootloader/build/wideband_bootloader.padded.bin: No such file or directo
cat: build/wideband_image.bin: No such file or directory
xxd: build/wideband_image.bin: No such file or directory
User avatar
AndreyB
Site Admin
Posts: 12802
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: How to compile the firmware

Post by AndreyB »

Boostonabudget wrote:
Sun Apr 25, 2021 4:49 pm
Having some issues getting anything to build firmware. Have Chibistudio installed with gnu gcc arm and everything I was told to get along with adding plenty of path directories.
I see at least three separate red flags here. Please close Chibistudio and focus on compiling things from command line. At the moment I suspect that you are compiling the wrong thing or maybe you've cloned source code from a wrong place or else, at the moment too much stuff is broken too badly.

There is an expectation that anyone who needs to compile the code should be able to figure it out without much hand holding. It is my honest, respectful and blunt opinion that most of the people unable to compile the code with all the information publicly available should not be doing it at all.

Well, I have no right to tell you how to spend your time but I have to be careful about how I spend my time supporting efforts which are not going well in my opinion.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Boostonabudget
Posts: 51
Joined: Thu Feb 27, 2020 1:15 am
Slack: Callum Henn***

Re: How to compile the firmware

Post by Boostonabudget »

AndreyB wrote:
Sun Apr 25, 2021 4:57 pm
Boostonabudget wrote:
Sun Apr 25, 2021 4:49 pm
Having some issues getting anything to build firmware. Have Chibistudio installed with gnu gcc arm and everything I was told to get along with adding plenty of path directories.
I see at least three separate red flags here. Please close Chibistudio and focus on compiling things from command line. At the moment I suspect that you are compiling the wrong thing or maybe you've cloned source code from a wrong place or else, at the moment too much stuff is broken too badly.

There is an expectation that anyone who needs to compile the code should be able to figure it out without much hand holding. It is my honest, respectful and blunt opinion that most of the people unable to compile the code with all the information publicly available should not be doing it at all.

Well, I have no right to tell you how to spend your time but I have to be careful about how I spend my time supporting efforts which are not going well in my opinion.
i totally agree and I'm not asking for hand outs, i have definitely given up on chibistudio and have got wsl up and running now. ill go through the forum and see what i can find
User avatar
AndreyB
Site Admin
Posts: 12802
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: How to compile the firmware

Post by AndreyB »

Boostonabudget wrote:
Sun Apr 25, 2021 4:49 pm
This is the error I get everytime:

Makefile:171: ../ChibiOS/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk: such file or directory
Damn, you are not compiling rusEFI! You are compiling https://github.com/mck1117/wideband/ It's unfortunate that such an important detail was omitted in your question. rusefi/rusefi and mck1117/wideband are related but very different repositories with different owners and different... everything.

And you have not downloaded git submodules so you are getting legit "no such file" while trying to compile partial source code.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
Matzs
Posts: 2
Joined: Tue May 25, 2021 7:33 am
Location: france

Re: How to compile the firmware

Post by Matzs »

I am new to IDE ECLIPSE and I have a problem compiling the firmware.
I would like to test the code on a DevEBox board:
https://stm32-base.org/boards/STM32F407VGT6-STM32F4XX-M
I would like to change
* PC10 - UART4 TX
* PC11 - UART4 Rx
to use SD card from PCB

for the moment I can not compile the firmware and i need your precious help.

:arrow: No rule to make target 'lapi.c'

Image
google picture hosting
User avatar
AndreyB
Site Admin
Posts: 12802
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: How to compile the firmware

Post by AndreyB »

git submodule update --init
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
Matzs
Posts: 2
Joined: Tue May 25, 2021 7:33 am
Location: france

Re: How to compile the firmware

Post by Matzs »

Thank you very much, I did not understand that it was necessary to import the Github with CMD.
Now it works fine and i have compiled and flash my 1st modified firmware on my demo board.
8-)
puff
contributor
contributor
Posts: 2923
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: How to compile the firmware

Post by puff »

okay, once again, winter madness..

I git cloned the repo, entered /firmware directory, did 'make' and got the following error:

Code: Select all

Compiling check.c
cc1: error: -Werror=implicit-fallthrough: no option -Wimplicit-fallthrough
make: *** [build/obj/check.o] Error 1
I downloaded the latest and gratest arm-none-eabi, which by default was installed to /Applications/ARM

With make GCC_ARM_PATH="/Applications/ARM/bin"
I still get the same error.

Code: Select all

/Applications/ARM/bin/arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/Applications/ARM/bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/Applications/ARM/bin/../lib/gcc/arm-none-eabi/10.3.1/lto-wrapper
Target: arm-none-eabi
Configured with: /tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/src/gcc/configure --target=arm-none-eabi --prefix=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native --libexecdir=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native/lib --infodir=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --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-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/install-native/arm-none-eabi --build=x86_64-apple-darwin10 --host=x86_64-apple-darwin10 --with-gmp=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/build-native/host-libs/usr --with-mpfr=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/build-native/host-libs/usr --with-mpc=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/build-native/host-libs/usr --with-isl=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/build-native/host-libs/usr --with-libelf=/tmp/jenkins-GCC-10-pipeline-338_20211018_1634516195/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-lstdc++ -lm' --with-pkgversion='GNU Arm Embedded Toolchain 10.3-2021.10' --with-multilib-list=rmprofile,aprofile
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210824 (release) (GNU Arm Embedded Toolchain 10.3-2021.10)
puff
contributor
contributor
Posts: 2923
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: How to compile the firmware

Post by puff »

вроде бы пошла сборка. прописал путь до новой версии через sudo nano /etc/paths
собралась минуты за четыре на десятилетнем ноуте.

Code: Select all

Creating build/rusefi.list
Creating build/rusefi.hex
Creating build/rusefi.bin
Creating build/rusefi.dmp

   text	   data	    bss	    dec	    hex	filename
 598336	   1996	 189168	 789500	  c0bfc	build/rusefi.elf
Creating build/rusefi.list

Done

Done
Creating build/rusefi.srec
bss Total size: 95925
ram4 Total size: 0
text Total size: 458480
data Total size: 1972
rodata Total size: 136722
 19 .ram4         0000eab8  10000000  08092914  000c0000  2**3
User avatar
AndreyB
Site Admin
Posts: 12802
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: How to compile the firmware

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply