[info] How to compile the firmware

It's all about the code!
Tom_Alp
Posts: 2
Joined: Mon Dec 19, 2022 3:07 pm

Re: How to compile the firmware

Post by Tom_Alp »

Hi Andrey,
Thanks for your answer, thus I'm using 'firmware' as suggested in your first post, not boot (which is a nested project if I'm correct).
Removed folders are not random, for sure that would not make sens. I was only an example, but this folders are not imported with the git command, they are created during compilation, by the makefile. So removing this folder was an example to restore the initial condition.
The 'make clean' command is not working properly here.

Code: Select all

PS C:\Users\--\Source\Local_Git\rusefi\firmware> make clean
No CCACHE_DIR
PROJECT_BOARD: f407-discovery
PROJECT_CPU:   ARCH_STM32F4
CPU_HWLAYER:   ports/stm32/stm32f4
CONFDIR:       ./hw_layer/ports/stm32/stm32f4/cfg
LDSCRIPT:      ./hw_layer/ports/stm32/stm32f4/STM32F4.ld
rm -f ./pch/pch.h.gch/firmware
process_begin: CreateProcess(NULL, rm -f ./pch/pch.h.gch/firmware, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
make: *** [rusefi_pch.mk:25: CLEAN_RULE_HOOK] Error 2

As I wrote down in the previous post, the incremental build is OK when it has been prepared manually :
image.png
image.png (119.18 KiB) Viewed 57143 times
But "Build All" option is not working.
Neo
Posts: 9
Joined: Thu Feb 02, 2023 12:09 pm
Github Username: Benjamin-neo

Re: How to compile the firmware

Post by Neo »

Hi all,
Did you know the way to have all working on windows 11, at this moment I can only use older pc on win10...
User avatar
AndreyB
Site Admin
Posts: 14360
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 »

Neo wrote:
Thu Feb 02, 2023 12:14 pm
Hi all,
Did you know the way to have all working on windows 11, at this moment I can only use older pc on win10...
Yes obviously everything works on win 11 just fine, reminder that windows 11 even self-identifies as Windows 10.

Please http://rusefi.com/s/questions
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
Neo
Posts: 9
Joined: Thu Feb 02, 2023 12:09 pm
Github Username: Benjamin-neo

Re: How to compile the firmware

Post by Neo »

thanks for your answer, ok if you tell me compil firmware on Win11 is like win10, I will look at. I doesn't yet understand where is the failure, but I will try again, just asking if win11 is problematic before spend some hour.
Attachments
screen.png
screen.png (46.81 KiB) Viewed 56806 times
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: How to compile the firmware

Post by mi-hol »

Hi Neo,
the recommended solution is to compile inside Windows Subsystem for Linux (WSL) in a Ubuntu 22.04 LTS environment.
Did you try that?
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
Neo
Posts: 9
Joined: Thu Feb 02, 2023 12:09 pm
Github Username: Benjamin-neo

Re: How to compile the firmware

Post by Neo »

Yes , I just have try, Exactly same problem. I will format my computer, and maybe with a little lucky .. it will be good. Will post news when I find solution or tips. thanks
User avatar
AndreyB
Site Admin
Posts: 14360
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 »

Well, technically we are on gcc 11 as of today https://github.com/rusefi/rusefi/commit/26b5a63d22df4800f1e1563e1dea33b0d2976837

But I've just installed gcc 12 and it did compile see https://github.com/rusefi/rusefi/issues/5031
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
Neo
Posts: 9
Joined: Thu Feb 02, 2023 12:09 pm
Github Username: Benjamin-neo

Re: How to compile the firmware

Post by Neo »

Thanks to all for tips , fresh install win 10, install same version make4.4 gcc12.2 , work directly, compil without any problem. I don't known if win11 was the problem or a system corrupt file.
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: How to compile the firmware

Post by hugovw1976 »

I compile on Windows 11 make 4.4 gcc12 and work fine (just some error compiling for proteus but for other board compile fine) .
Icebear1983
Posts: 1
Joined: Thu Aug 26, 2021 10:05 pm

Re: How to compile the firmware

Post by Icebear1983 »

Somehow I seem just to stupid to do the compilation ... for the wideband controller in my case.

GCC version 13 and GNU Make 4.4.1 on Windows 10 Pro

I always end up with "arm-none-eabi-objcopy: command not found"
The path variable has the correct link to the ARM_GNU toolchain.

Can maybe somebody point me in the right direction?
User avatar
AndreyB
Site Admin
Posts: 14360
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 »

Icebear1983 wrote:
Thu Dec 21, 2023 8:41 pm
Can maybe somebody point me in the right direction?
I can only suggest the workaround of using github actions since those work the same for everyone
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
zed65
Posts: 44
Joined: Sun Sep 24, 2023 5:43 pm

Re: How to compile the firmware

Post by zed65 »

I'm trying to compile the master but it throws some errors:
make3.png
make3.png (57.96 KiB) Viewed 49425 times
Any ideas what the problem might be?
User avatar
AndreyB
Site Admin
Posts: 14360
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 »

image.png
image.png (3.87 KiB) Viewed 49424 times
spaces in gcc path are the problem
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
zed65
Posts: 44
Joined: Sun Sep 24, 2023 5:43 pm

Re: How to compile the firmware

Post by zed65 »

Hah! Thank you!
It was really that "easy".. Is that rule mentioned somewhere?
User avatar
AndreyB
Site Admin
Posts: 14360
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 »

zed65 wrote:
Wed Jan 03, 2024 10:23 pm
Is that rule mentioned somewhere?
https://github.com/rusefi/rusefi/issues/5861
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
Dron_Gus
contributor
contributor
Posts: 460
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: How to compile the firmware

Post by Dron_Gus »

AndreyB wrote:
Wed Jan 03, 2024 10:01 pm
image.png

spaces in gcc path are the problem
or brackets.
Atlantis2013
Posts: 5
Joined: Fri Dec 01, 2023 2:56 pm

Re: How to compile the firmware

Post by Atlantis2013 »

Hi everyone,

I have a little problem, just update new tool chain kit arm and impossible for compiling.
overstack memory, new compiler use more bytes

thx

Image
User avatar
AndreyB
Site Admin
Posts: 14360
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
Atlantis2013
Posts: 5
Joined: Fri Dec 01, 2023 2:56 pm

Re: How to compile the firmware

Post by Atlantis2013 »

i back on 12.3 and its ok
i_s_64
Posts: 15
Joined: Tue Mar 14, 2023 1:15 am

Re: How to compile the firmware

Post by i_s_64 »

Hello,

I have a problem trying to run a build of the latest rusefi proteus firmware. It will compile fine, but it does not start up when I load the bin file on a Rusefi proteus that's running an STM32F429

I used to compile the firmware a few years ago on a Windows machine. I decided to see if I can work with the present code, and based on recommendations here it said I should be compiling it in Linux. Currently I am running VirtualBox with Ubuntu to compile the firmware

For reference, I go into the folder /rusefi/firmware/config/boards/proteus
and I run the script with
sh ./compile_proteus_f4.sh

I take the bin file from the build folder over a shared folder to my windows desktop, and I load it on a Proteus with STLink.

What happens is the unit now refuses to start up. No USB connection, no status lights. If I load up the old BIN that I saved before putting in this compiled file, it works exactly as it has for the past few years.
When I run the script compile_proteus_f4_debug.sh in the proteus board folder it actually allows the proteus board to start up, but that debug variant doesn't have LUA, ETB, Boost control and other things when I load it up. It does start up, but it takes out the functionality. When I add the features I need back in like LUA, it makes the firmware file too large and can't be linked. If I change the debug level it will not run in the ECU anymore

A few points to mention, since this is my first step before trying to modify the code, I am just compiling it exactly as I clone it from github. No changes to the code.
I've found that the actual compiled file size is smaller than a precompiled binary that I downloaded at the exact same time as I cloned the repository
I can run a make in the firmware folder with an f407-discovery as the Short Board Name and it will compile fine, load up and run fine on the STM32F429 Proteus board. But if I try to do the same with the f429-discovery, it will compile but also stop the proteus board from running

I have attached the log of me compiling the proteus f4 script ./compile_proteus_f4.sh. It's almost as if components of the code are not being compiled in the firmware. Can anyone see if I'm missing something or know what the problem could be?

Thanks
Attachments
BuildLog.log
(80.16 KiB) Downloaded 4 times
User avatar
Dron_Gus
contributor
contributor
Posts: 460
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: How to compile the firmware

Post by Dron_Gus »

i_s_64 wrote:
Sat May 18, 2024 8:42 pm
sh ./compile_proteus_f4.sh
Proteus now uses OpenBLT bootloader. Bin file you are getting is generated with some offset to coexist with bootloader. Bootloader also needs to be flashed.
Or you can disable bootloader by editing env file and removing line "USE_OPENBLT=yes".
i_s_64
Posts: 15
Joined: Tue Mar 14, 2023 1:15 am

Re: How to compile the firmware

Post by i_s_64 »

Dron_Gus wrote:
Sat May 18, 2024 9:31 pm
Proteus now uses OpenBLT bootloader. Bin file you are getting is generated with some offset to coexist with bootloader. Bootloader also needs to be flashed.
Or you can disable bootloader by editing env file and removing line "USE_OPENBLT=yes".
Thank you very much. That was the answer that I spent a full day trying to get working. I first disabled OPENBLT in the env file and it worked. Then I looked at the compiled hex file and noticed it is offset by 0x8000. When I was writing it to the chip I would always do a complete chip erase and didn't notice it wasn't writing from 0x8000000. I then compiled OpenBLT files and loaded them both on the same chip and it works

Thank you very much. This is great!
Post Reply