Trouble compiling code for Proteus F4
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Trouble compiling code for Proteus F4
Hi, I clone repository and compiling code for a custom board (Pin to pin F4 proteus compatible), I compile my code just for change some can messages for Haltech dash.
I update firmware to 2022.08.19 and compile fine (compile firmware without any change in code just to check fawlt it's not for code changes) but when I upload to the board don't work, Power Led on, all other leds off and when connect usb cable to PC don't detect any device.
I compile using compile_proteus_f4.sh the same way from previus version (from 2022.01.06 to 2022.06.07)and all work fine until now.
Any advice what can be wrong?
I update firmware to 2022.08.19 and compile fine (compile firmware without any change in code just to check fawlt it's not for code changes) but when I upload to the board don't work, Power Led on, all other leds off and when connect usb cable to PC don't detect any device.
I compile using compile_proteus_f4.sh the same way from previus version (from 2022.01.06 to 2022.06.07)and all work fine until now.
Any advice what can be wrong?
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
Does this board run official Proteus firmware?
Custom CAN bus stuff sounds like Lua scripting not custom C++ code to me.
Custom CAN bus stuff sounds like Lua scripting not custom C++ code to me.
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
On the other hand since we have canDashboardHaltech method in C++ should this be a public pull request to contribute? If you want to test reminder that github actions would have binary artifacts of your custom branch.
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
Yes the original Proteus firmware runs fine (on bench and installed on engine I test all inputs and outputs and it's fine engine not running yet because I'm working in custom intake for supercharger).
The problem for Lua scrip is can_dash.cpp all ready send the messages I need to send but I can't assign new value, will be great if can assign custom values to some messages, for example:
can_dash.cpp (for Haltech) send:
Code: Select all
CanTxMessage msg(CanCategory::NBC, 0x3E5, 8);
msg[0] = 0x00;
msg[1] = 0x00;
msg[2] = 0x00;
msg[3] = 0x00;
msg[4] = 0x00;
msg[5] = 0x00;
msg[6] = 0x00;
msg[7] = 0x00;
Code: Select all
CanTxMessage msg(CanCategory::NBC, 0x3E5, 8);
msg[0] = IgnitionSwitch;
msg[1] = TurboTimerTimeRemaining;
msg[2] = TurboTimerEngineTimeRemaining;
msg[3] = 0x00
msg[4] = (SteeringWheelAngle >> 8);
msg[5] = (SteeringWheelAngle & 0x00ff);
msg[6] = (DriveShaftRPM >> 8);
msg[7] = (DriveShaftRPM & 0x00ff);
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
Wow, you seem to have a lot of cool stuff! Would you by any chance be interested to start contributing it into the main branch?
Do you have your changes publicly available on your fork?
With Lua vs C++, it's all or nothing.
Do you have your changes publicly available on your fork?
With Lua vs C++, it's all or nothing.
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
I'm not very familiar with the code from rusefi, I work on Arduino IDE and all the modules I have in my car are programed in Arduino IDE. The only changes I made on rusefi firmware are on can_dash.ccp and only change the ID of the message in order to when my ecu send the messages to my dash don't send the message to the rigth ID so for example the module that reads Speed on all 4 wheels send the message instead.
But I you have patien I can try.
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
please publish your version somewhere, maybe even attach your can_dash.cpp here
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
This is my can_dash.cpp file but even with the original cad_dash file have the same error (I all ready clone repository to new folder to have fresh one) compile fine but if I upload to my board no led flashing only power led on, If I upload the latest original release August 2022 work fine but If I compile from repository don't work.
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
Do not see TurboTimerEngineTimeRemaining in the file you have attached, sound like attachements would not work as a way to learn more about your custom changes.
I see that github actions are invoked on some forks like https://github.com/mck1117/rusefi/tree/fix-inverted-vvt but not on your https://github.com/hugovw1976/rusefi I would recomment to reset your fork to match upstream. If you leverage branches on github you should have github compile firmware for you - that's obviously just a work around around your local issue. Too little information for me to have theories on why you local builds are not good.
I see that github actions are invoked on some forks like https://github.com/mck1117/rusefi/tree/fix-inverted-vvt but not on your https://github.com/hugovw1976/rusefi I would recomment to reset your fork to match upstream. If you leverage branches on github you should have github compile firmware for you - that's obviously just a work around around your local issue. Too little information for me to have theories on why you local builds are not good.
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
Ok, for now let's forget about any firmware changes, I clone a clean repository (latest) and compile stock firmware for proteus F4, compile fine but I get the same error when upload firmware to the board, no flash leds only power led is on and PC don't detect the board when connect USB.
I have a copy of 2022.06.07 and I compile (I delete the build folder for a new clean compilation) and upload firmware to the board and works fine, it's only with the lates version I have the problem.
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
That's unexpected behaviour.
At the moment too little information is provided, I have no idea how to help so many things could be bad
At the moment too little information is provided, I have no idea how to help so many things could be bad
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
Yes very weird behaviour, I try "compile_proteus_f4_hardware_QC_special_build.sh" and work fine USB to PC connection work, all injector/ignition leds run sequential, estra LS and HS outputs work to (I have leds in all outputs in my board). Tuner Studio detect 2022.08.20
But if I try "compile_proteus_f4.sh" no USB connection and no led on other than Power led.
So I don't know wath can be wrong because if was something related with my PC or my repository I think the QC special build must do the same error.
Any advice what can check to have more information.
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
Did you get the dash to work? Can you share any videos on youtube ideally?hugovw1976 wrote: ↑Sat Aug 20, 2022 5:58 pmI compile my code just for change some can messages for Haltech dash.
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
I don't take video, but the dash work fine with previus firmware (2022.01.06 to 2022.06.07) with newers firmwares I don't tested yet because I send some custom values from other can modules and plan to send dash values from ECU using LUA (science I can compile firmware any more) but right now I'm very busy and don't star to implement the LUA script.AndreyB wrote: ↑Mon Feb 27, 2023 5:59 pmDid you get the dash to work? Can you share any videos on youtube ideally?hugovw1976 wrote: ↑Sat Aug 20, 2022 5:58 pmI compile my code just for change some can messages for Haltech dash.
I can test if the dash work with stock firmware on weekend and take some videos. By the way my dash is AIM MXL Pista (dash can conect to Haltech protocol). And I saw the latest firmwares have AIM protocol so I test too.
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
Hi Andrey just find the problem when compile for my board (custom Proteus F4 compatible with stock firmware).
I compile running script compile_proteus_f4.sh and by default (don't know how to change this) compile for engine vw_b6. In vw_b6.ccp line 201 have #include "vw_b6.lua" and there is a trouble with this file. I atach image with the error. If I edit vw-b6.cpp and coment //#include "vw_b6.lua compile without any problem.
- Attachments
-
- rusEFI1.png (7.66 KiB) Viewed 17067 times
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
Meaning that your way of compiling ignores https://github.com/rusefi/rusefi/blob/c08e4c3af5315da176271e8ca831a71caa452f32/firmware/config/boards/proteus/prepend.txt#L31
Just created https://github.com/rusefi/rusefi/issues/5144 even while it's a variation of https://github.com/rusefi/rusefi/issues/4302
Just created https://github.com/rusefi/rusefi/issues/5144 even while it's a variation of https://github.com/rusefi/rusefi/issues/4302
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
It's any source on how to correct way to compile to a specific board, project, etc. Other than the compile_proteus_f4 script, in the post of how to compile can't fine the way to compile for a specific target boardAndreyB wrote:Meaning that your way of compiling ignores https://github.com/rusefi/rusefi/blob/c08e4c3af5315da176271e8ca831a71caa452f32/firmware/config/boards/proteus/prepend.txt#L31
Just created https://github.com/rusefi/rusefi/issues/5144 even while it's a variation of https://github.com/rusefi/rusefi/issues/4302
Sorry if this is very noob question, but I come from arduino IDE and still in learning process.
Thanks.
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
What is root cause of custom firmware? What changes are you working on? Would others benefit from your changes?
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
The main reason to change firmware it's just for the can dash messages for my AIM Pista dash, on Haltech can protocol just because have more info channels than AIM can protocol, the problem is rusefi firmware send all messages even ones without data and in my can network I have some custom modules that send some of this messages.AndreyB wrote:What is root cause of custom firmware? What changes are you working on? Would others benefit from your changes?
I send:
0x36B Lateral G
0x36C Independent wheel speeds
0x36E Longitudinal G
0x376 Ambient Air Temperature
0x3E5 Steering Wheel Angle
-
- running engine in first post
- Posts: 1494
- Joined: Mon Jan 30, 2017 2:05 am
- Location: Seattle-ish
Re: Trouble compiling code for Proteus F4
is Lua a better fit for this? No firmware mods required.hugovw1976 wrote: ↑Thu Mar 02, 2023 2:22 amcan dash messages for my AIM Pista dash, on Haltech can protocol just because have more info channels than AIM can protocol, the problem is rusefi firmware send all messages even ones without data and in my can network I have some custom modules that send some of this messages.
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
Ok just need time to check how to implement Lua.
Thanks.
Thanks.
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
Testing can connection for AIM Pista dash on Haltech protocol stock firmware have some conflict with gear, outside temp, lateral and long acceletation messages (I send this values with custom module)
Custom firmware (delete some Haltech can dash messages only)
Custom firmware (delete some Haltech can dash messages only)
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
Please create a github ticket
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
- AndreyB
- Site Admin
- Posts: 14333
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: Trouble compiling code for Proteus F4
have 100hz tick
have a counter
if counter % 10 equals 0 you are on 10 hz
if counter % 5 equals 0 you are on 20hz (100 divided by 5 is 20)
if counter % 2 equals 0 you are on (100 / 2) hz
have a counter
if counter % 10 equals 0 you are on 10 hz
if counter % 5 equals 0 you are on 20hz (100 divided by 5 is 20)
if counter % 2 equals 0 you are on (100 / 2) hz
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
-
- Posts: 68
- Joined: Fri Oct 16, 2020 3:10 pm
- Github Username: hugovw1976
Re: Trouble compiling code for Proteus F4
@AndreyB
I star playing with LUA script to send the Haltech dash messages (minus some messages I send with external modules), but I have some question, for basic sensors I don't have any trouble, I use: getSensor(Rpm) and this work on LUA script.
But some of the values Haltech can send I don't know how to get it:
(Sensor : how can_dash handle the value)
Injector Duty Cycle : tmp = (uint16_t)( getInjectorDutyCycle(rpm) * 10) ;
Ignition Angle : ignAngle = ((timing > 360 ? timing - 720 : timing) * 10);
Trigger System Error Count : tmp = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
Trigger Counter : tmp = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_FALLING);
Knock Level 1 : tmp = (engine->outputChannels.knockLevel * 100);
Any tip how to get this values?
Thanks.
I star playing with LUA script to send the Haltech dash messages (minus some messages I send with external modules), but I have some question, for basic sensors I don't have any trouble, I use: getSensor(Rpm) and this work on LUA script.
But some of the values Haltech can send I don't know how to get it:
(Sensor : how can_dash handle the value)
Injector Duty Cycle : tmp = (uint16_t)( getInjectorDutyCycle(rpm) * 10) ;
Ignition Angle : ignAngle = ((timing > 360 ? timing - 720 : timing) * 10);
Trigger System Error Count : tmp = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
Trigger Counter : tmp = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_FALLING);
Knock Level 1 : tmp = (engine->outputChannels.knockLevel * 100);
Any tip how to get this values?
Thanks.