Trouble compiling code for Proteus F4

It's all about the code!
Post Reply
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Trouble compiling code for Proteus F4

Post by hugovw1976 »

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?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

Does this board run official Proteus firmware?

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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

hugovw1976 wrote:
Sat Aug 20, 2022 5:58 pm
change some can messages for Haltech dash.
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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Sat Aug 20, 2022 6:18 pm
Does this board run official Proteus firmware?

Custom CAN bus stuff sounds like Lua scripting not custom C++ code to me.
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;
But I have steering wheel angle, (and other sensors that proteus don't have) the original haltech message for this ID must be:

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);
So for those messages that can_dash send only 0x00 is any way to assign a variable in order to make a Lua script to assign some receive can message to this variables?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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.
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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Sat Aug 20, 2022 8:23 pm
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.
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.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

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.
can_dash.cpp
(30.48 KiB) Downloaded 317 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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.
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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Sun Aug 21, 2022 1:47 am
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.
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.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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 :(
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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Sun Aug 21, 2022 5:24 pm
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 :(
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.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

hugovw1976 wrote:
Sat Aug 20, 2022 5:58 pm
I compile my code just for change some can messages for Haltech dash.
Did you get the dash to work? Can you share any videos on youtube ideally?
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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Mon Feb 27, 2023 5:59 pm
hugovw1976 wrote:
Sat Aug 20, 2022 5:58 pm
I compile my code just for change some can messages for Haltech dash.
Did you get the dash to work? Can you share any videos on youtube ideally?
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.
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.
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Mon Feb 27, 2023 5:59 pm
Did you get the dash to work? Can you share any videos on youtube ideally?
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
rusEFI1.png (7.66 KiB) Viewed 15150 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

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 board
Sorry if this is very noob question, but I come from arduino IDE and still in learning process.
Thanks.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:What is root cause of custom firmware? What changes are you working on? Would others benefit from your changes?
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.
I send:
0x36B Lateral G
0x36C Independent wheel speeds
0x36E Longitudinal G
0x376 Ambient Air Temperature
0x3E5 Steering Wheel Angle
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Trouble compiling code for Proteus F4

Post by mck1117 »

hugovw1976 wrote:
Thu Mar 02, 2023 2:22 am
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.
is Lua a better fit for this? No firmware mods required.
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

Ok just need time to check how to implement Lua.
Thanks.
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

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)

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

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

mck1117 wrote:
Thu Mar 02, 2023 2:23 am
is Lua a better fit for this? No firmware mods required.
How to implement different heartz rate, haltech send some messages on 5Hz, 10Hz, 20Hz, 50Hz on LUA I set the rate with setTickRate().
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Trouble compiling code for Proteus F4

Post by AndreyB »

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
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
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

AndreyB wrote:
Sat Apr 08, 2023 10:08 pm
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
👍🏻 Thanks
hugovw1976
Posts: 68
Joined: Fri Oct 16, 2020 3:10 pm
Github Username: hugovw1976

Re: Trouble compiling code for Proteus F4

Post by hugovw1976 »

@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.
Post Reply