How to compile source code for FreeEMS

Official FreeEMS vanilla firmware development, the heart and soul of the system!
whizzo944
QFP80 - Contributor
Posts: 53
Joined: Sun Mar 27, 2011 9:35 am
Location: Durham, U.K.

How to compile source code for FreeEMS

Post by whizzo944 »

Hello All,
Please can anyone give me a quick crash (sorry) course in how to compile the source code, either under Windows or some
flavour of Linux.

TIA,

Dave.
whizzo944
QFP80 - Contributor
Posts: 53
Joined: Sun Mar 27, 2011 9:35 am
Location: Durham, U.K.

Re: How to compile source code for FreeEMS

Post by whizzo944 »

Sorry,
Didn't look first, looks like there is already a thread covering this.

Dave.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: How to compile source code for FreeEMS

Post by Fred »

On 32 bit windows, install git, install the tools, open git bash, cd somewhere convenient, clone the source, make BENCHTEST, done. make with no args lists the options. cd src/main and then make for a bigger rundown. etc.

On 32 bit deb/ubuntu, same process exactly.

Building in windows CMD/DOS is not supported.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
whizzo944
QFP80 - Contributor
Posts: 53
Joined: Sun Mar 27, 2011 9:35 am
Location: Durham, U.K.

Re: How to compile source code for FreeEMS

Post by whizzo944 »

Hello All,
When I try to compile, if I use a name after Make, I get a "path not found" error.
If I type Make all, it compiles and produces a load of .s19 files in the firmware subdirectory,
but when I look, there are 2 .s19 files of each type, but 1 of them has a .gc.s19 extension and the other just has a .s19 extension. But the 2 files are different sizes. All of this is done in Windows 7
BTW.


TIA,

Dave.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: How to compile source code for FreeEMS

Post by Fred »

In future you should paste the command and the output from it, to save time.

Was this in the src/main level or in the top level?

There are two make files. Top level one is for configured user builds (what you need), lower is for general builds and is what is called into by the top level one.

So in src/main you can still do what you want, but it's more complicated. In the top level you should do make WHIZZO944 and if it fails, it's because you didn't setup that alias in the top level file. So perhaps read/edit it first.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
whizzo944
QFP80 - Contributor
Posts: 53
Joined: Sun Mar 27, 2011 9:35 am
Location: Durham, U.K.

Re: How to compile source code for FreeEMS

Post by whizzo944 »

Hello All,
I've moved to Linux for compiling the firmware, it seems to be better somehow :-)

Can anyone please explain this bit of the FixedConfig1 file ?

#elif CONFIG == WHIZZO944_ID // Whizzo944's Honda VFR400R NC30 bike
anglesOfTDC: {ANGLE(0), ANGLE(90), ANGLE(360), ANGLE(450), ANGLE(0), ANGLE(90), ANGLE(360), ANGLE(450)},
outputEventPinNumbers: {0,1,2,3,4,5,4,5}, // Wasted Spark and semi-sequential
schedulingConfigurationBits: {0,0,0,0,1,1,1,1}, // First four ignition, last four fuel
decoderEngineOffset: ANGLE(70.00), //
numberOfConfiguredOutputEvents: 8, // Migrated to new way
numberOfInjectionsPerEngineCycle: 2 // Used to be batch, dead time being wrong could have affected AFRs

TIA,

Dave.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: How to compile source code for FreeEMS

Post by Fred »

The above, as it states in the file is the schedulingSettings. IE, when to turn on timed outputs, and how long to keep them on. A source of pulsewidth and timing is needed for each, and a base angle within your decoder total angle. The above implies you have a 720 decoder angle, which is untrue if you're using missing tooth on the crank. Additionally decoderEngineOffset should be zero until you measure it empirically on the car/engine.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
whizzo944
QFP80 - Contributor
Posts: 53
Joined: Sun Mar 27, 2011 9:35 am
Location: Durham, U.K.

Re: How to compile source code for FreeEMS

Post by whizzo944 »

Hello,
Is this better ?

#elif CONFIG == WHIZZO944_ID // Whizzo944's Honda VFR400R NC30 bike
anglesOfTDC: {ANGLE(0), ANGLE(90), ANGLE(0), ANGLE(90)},
outputEventPinNumbers: {0,1,2,3,4,5,4,5}, // Wasted Spark and semi-sequential
schedulingConfigurationBits: {0,0,1,1}, // First two ignition, last two fuel
decoderEngineOffset: ANGLE(70.00), //
numberOfConfiguredOutputEvents: 4, // Migrated to new way
numberOfInjectionsPerEngineCycle: 2 // Used to be batch, dead time being wrong could have affected AFRs

Please can you explain outputEventPinNumbers ?

Is the decoderEngineOffset related to the angle of the missing tooth relative to TDC ?
If this is the case, my missing tooth is at 70deg BTDC.

TIA,

Dave.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: How to compile source code for FreeEMS

Post by Fred »

whizzo944 wrote: Is this better ?
Yes, however:

1) the arrays should be equal length
2) you might want to wire up four injector outputs for future software updates (6 entries)
Please can you explain outputEventPinNumbers ?
Which hardware pin each entry is output on.
Is the decoderEngineOffset related to the angle of the missing tooth relative to TDC ?
If this is the case, my missing tooth is at 70deg BTDC.
Yes but I never calculate it as you MUST check it with a timing light anyway. So I just set it up cranking.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
whizzo944
QFP80 - Contributor
Posts: 53
Joined: Sun Mar 27, 2011 9:35 am
Location: Durham, U.K.

Re: How to compile source code for FreeEMS

Post by whizzo944 »

For some of us mere mortals, C is just the third letter in the alphabet ;-)
Post Reply