ECU high-level programming

It's all about the code!
Post Reply
User avatar
AndreyB
Site Admin
Posts: 11403
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

ECU high-level programming

Post by AndreyB »

Since very early days of rusEFI I am curious about a toolchain for higher-level programming. I still do not have a great solution.

FSIO is an approach where we build our own language - that's really a lot of effort, FSIO would never be making developers more efficient, only limited scope. Not really an option.

https://rusefi.com/forum/viewtopic.php?f=5&t=741 did not go anywhere - an open source toolchain for model-based development does not seem to exist.

A funny option would be to embed a subset of java JVM - even a single-threaded or limited-threaded java runtime with garbage collection could be useful for the slower and richer areas of the codebase. No embeddable JVM I am aware of, it could be fun to make one from existing pieces but that's really a side gig.

Maybe Rust? Rust seems to depend on LLVM, ChibiOS claims clang support - so maybe Rust.

Another not great option would be to move high-level computation to a separate CPU running non-real-time linux and keep arm/chibios only for the quick stuff.

What else is around?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
User avatar
AndreyB
Site Admin
Posts: 11403
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: ECU high-level programming

Post by AndreyB »

https://github.com/rusefi/funnyvm is the attempt to pile together a subset of a JVM in 5 minutes. So far it's a failed attempt - I do not speak Makefile enough :(
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
mck1117
running engine in first post
running engine in first post
Posts: 875
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: ECU high-level programming

Post by mck1117 »

AndreyB wrote:
Tue Apr 20, 2021 3:26 am
Maybe Rust? Rust seems to depend on LLVM, ChibiOS claims clang support - so maybe Rust.
As far as we're concerned, Rust is functionally the same as C++. Both compile to native code. No runtime for either. Not really much level than c++.

If your concern is ease of access, ease of learning, and ease of editing code on the ECU, Rust is not the place. The toolchain, build, and deploy process would look the same.
AndreyB wrote:
Tue Apr 20, 2021 3:26 am
Since very early days of rusEFI I am curious about a toolchain for higher-level programming. I still do not have a great solution.

FSIO is an approach where we build our own language - that's really a lot of effort, FSIO would never be making developers more efficient, only limited scope. Not really an option.

https://rusefi.com/forum/viewtopic.php?f=5&t=741 did not go anywhere - an open source toolchain for model-based development does not seem to exist.

A funny option would be to embed a subset of java JVM - even a single-threaded or limited-threaded java runtime with garbage collection could be useful for the slower and richer areas of the codebase. No embeddable JVM I am aware of, it could be fun to make one from existing pieces but that's really a side gig.

Another not great option would be to move high-level computation to a separate CPU running non-real-time linux and keep arm/chibios only for the quick stuff.
I am still not yet sure what kind of problem you are trying to solve.

Can you please precisely define:
  • making developers more efficient
  • higher level programming
  • slower and richer areas of the codebase
mck1117
running engine in first post
running engine in first post
Posts: 875
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: ECU high-level programming

Post by mck1117 »

Have you heard of Lua? It's already used for embedded automotive applications on STM32: https://wiki.autosportlabs.com/RaceCapturePro_Lua_Scripting
User avatar
kb1gtt
contributor
contributor
Posts: 3715
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: ECU high-level programming

Post by kb1gtt »

Most OEMs have tools which allow then to specify high level stuff. They spec number of cyls, injector flow rates, etc. The tool then splices together the code they need to operate the engine. I recall Freescale has one that can be downloaded for free.
Welcome to the friendlier side of internet crazy :)
OrchardPerformance
contributor
contributor
Posts: 286
Joined: Tue Jul 24, 2018 8:55 pm

Re: ECU high-level programming

Post by OrchardPerformance »

I will admit I can only see the need in terms of people making their own algorithms or strategies. Which leads me to think that the number of people that need it is very small and the number of those willing to put the work in to achieve it is even smaller.

The FSIO is a case where MATLAB or SciLab would work but that comes with big additional challenges of integrating any of it's auto generated code.

I feel a lot of what we are trying to cover here would be well served by an online or GUI based FSIO calculator. Something that we could use to interpret the input equation in more normal math notation and have it generate the FSIO compatible RPN output.
Now keeping MRE and Proteus in stock in the UK, PM or slack for details.
User avatar
kb1gtt
contributor
contributor
Posts: 3715
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: ECU high-level programming

Post by kb1gtt »

If we integrate into scratch, we could potentially attract many kids they would work for free.
https://scratch.mit.edu/

Scratch is a fairly decent graphical / easy to use programming environment. It might not be that far fetch of an idea to use as a higher level programming environment.
Welcome to the friendlier side of internet crazy :)
mck1117
running engine in first post
running engine in first post
Posts: 875
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: ECU high-level programming

Post by mck1117 »

kb1gtt wrote:
Tue Apr 20, 2021 9:10 pm
Scratch is a fairly decent graphical / easy to use programming environment. It might not be that far fetch of an idea to use as a higher level programming environment.
I think you are confusing "high level" and "simple". Simple languages can be high or low level, and high level languages can be simple or complex.

Scratch is a high level, simple language.

C#, Java, C++, and Rust are high level, complex languages.

Lua, JavaScript (ECMAScript) and Python are high level and somewhere in the middle, these days leaning complex.
User avatar
AndreyB
Site Admin
Posts: 11403
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: ECU high-level programming

Post by AndreyB »

mck1117 wrote:
Tue Apr 20, 2021 6:55 am
Have you heard of Lua? It's already used for embedded automotive applications on STM32: https://wiki.autosportlabs.com/RaceCapturePro_Lua_Scripting
http://www.eluaproject.net/ that might be winner here! There is also https://github.com/linvinus/chibios_with_elua which would probably need to be ported to fresh ChibiOS
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239
mck1117
running engine in first post
running engine in first post
Posts: 875
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: ECU high-level programming

Post by mck1117 »

AndreyB wrote:
Wed Apr 21, 2021 4:24 pm
mck1117 wrote:
Tue Apr 20, 2021 6:55 am
Have you heard of Lua? It's already used for embedded automotive applications on STM32: https://wiki.autosportlabs.com/RaceCapturePro_Lua_Scripting
http://www.eluaproject.net/ that might be winner here! There is also https://github.com/linvinus/chibios_with_elua which would probably need to be ported to fresh ChibiOS
Racecapture's firmware is also open source https://github.com/autosportlabs/RaceCapture-Pro_firmware
Post Reply