Simulator Compilation Problem

It's all about the code!
Post Reply
lmou
Posts: 5
Joined: Sat Apr 18, 2020 10:29 pm

Simulator Compilation Problem

Post by lmou »

As I understood from the website, the simulator allows running the firmware without any hardware. I ran the simulator jar rusefi_console.jar, however,I need to compile and run the simulator source code to have the option of debugging and modifying it.
I have followed the steps listed in "How to compile the firmware" (https://rusefi.com/forum/viewtopic.php?f=5&t=9), and could successfully build the firmware.
screenshot1.png
screenshot1.png (14.41 KiB) Viewed 4891 times
Similarly, I tried the same steps to build the simulator, but I am getting errors.
Using "make" command in the simulator folder, I am getting the following errors

Code: Select all

make: i686-w64-mingw32-gcc: No such file or directory
make: *** [../firmware/ChibiOS/os/common/startup/SIMIA32/compilers/GCC/rules.mk:136: build/obj/chcore.o] Error 127
Make_Error.png
Make_Error.png (11.1 KiB) Viewed 4891 times
Also using eclipse (Eclipse IDE for C/C++ Developers, version: 4.15.0), I am getting:

Code: Select all

make: *** [../firmware/ChibiOS/os/common/startup/SIMIA32/compilers/GCC/rules.mk:136: build/obj/chcore.o] Error 127

Then, I get the error "Program "g++" not found in PATH", though in the build path i added GNU Tools Arm Embedded\9 2019-q4-major\bin; C:\cygwin64\bin; and C:\MinGW\bin. I did not face these issues for the firmware and am wondering if the same steps apply to the simulator or if there are some other steps which i did not find that can help me compile, build and run the simulator from some IDE (not necessarily eclipse).

I appreciate if anyone can help me to successfully compile the simulator.

Thank you.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Simulator Compilation Problem

Post by AndreyB »

lmou wrote:
Sat Apr 18, 2020 11:13 pm
I ran the simulator jar rusefi_console.jar
looks like a confusion here?

rusefi.hex - firmware for MCU, usually stm32
rusefi_simulator.exe - windows command line tool which is sharing source code with real rusEfi firmware
rusefi_console.jar - rusEfi console, a java UI tool which communicates with either firmware on MCU or simulator on your PC


firmware is build using gnu arm gcc, sounds like you have this installed

make is the same between firmware and simulator, sounds like you have this intalled

simulator is compiled by make using a cygwin version of windows gcc compiler (and obviously has nothing to do with GNU Tools Arm Embedded)

can you run
i686-w64-mingw32-gcc -v
?

Kudos for providing all the details I could think of right away, it's a please answering questions like that!
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
lmou
Posts: 5
Joined: Sat Apr 18, 2020 10:29 pm

Re: Simulator Compilation Problem

Post by lmou »

Thanks a lot for your swift response. It looks like "i686-w64-mingw32-gcc" was actually missing in cygwin. I installed now and when running

Code: Select all

i686-w64-mingw32-gcc -v
i get the following:
Screenshot_4.png
Screenshot_4.png (37.87 KiB) Viewed 4881 times
As a result of that i was able to get rid of the previous error messages successfully.
Unfortunately, now I am getting the below error when trying to build using eclipse:
Screenshot_2.png
Screenshot_2.png (25.93 KiB) Viewed 4881 times
Also, the same error when using the command prompt:
Screenshot_3.png
Screenshot_3.png (16.23 KiB) Viewed 4881 times
Thank you, I appreciate your response.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Simulator Compilation Problem

Post by AndreyB »

Once in a while https://github.com/rusefi/rusefi/commits/master would not compile here and there. I wonder if that's the case - are you trying to compile your fork? Can you refresh your fork? Or if you have downloaded code somehow else, can you download latest?

https://github.com/rusefi/rusefi/blob/master/misc/git_scripts/git_reset_to_upstream.bat could be relevant
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
lmou
Posts: 5
Joined: Sat Apr 18, 2020 10:29 pm

Re: Simulator Compilation Problem

Post by lmou »

I cloned rusefi from

Code: Select all

https://github.com/rusefi/rusefi
when i try to run

Code: Select all

git_reset_to_upstream.bat
i get an error saying i do not have the rights to.
I tried running the .bat file, running the command in cmd and in cygwin with the same outcome:
Screenshot_5.png
Screenshot_5.png (6.87 KiB) Viewed 4878 times
Screenshot_1.png
Screenshot_1.png (39.89 KiB) Viewed 4878 times
I'm sorry for the troubles but I'm new to all this and trying to get started. Your help is highly appreciated.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Simulator Compilation Problem

Post by AndreyB »

You did not fork so you have nothing to reset.

You simply need
git pull
To update

Maybe just download latest as .zip while you are getting up to speed with git
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
lmou
Posts: 5
Joined: Sat Apr 18, 2020 10:29 pm

Re: Simulator Compilation Problem

Post by lmou »

It is working now. Thank you a lot for your help.
Post Reply