Porting firmware to GCC

General English language SECU-3 discussions here. Обсуждение общих вопросов SECU-3 на английском.

Moderator: STC

User avatar
STC
LQFP144 - On Top Of The Game
Posts: 2420
Joined: Fri Oct 22, 2010 10:47 pm
Location: Ukraine, Kiev
Contact:

Re: Porting firmware to GCC

Post by STC »

I'll have to have a look at how you've done that! My make file deps are manual and prone to error, not cool. I need to improve that situation. Thanks for posting about it! :-)
I'm using -MD option for GCC. This option make it to generate separate dependency file (*.d) for each source file. Also you have to inclue list of mentioned dependency files to Makefile:
OBJECTS = $(SRC:%.c=$(OBJDIR)/%.o)
DEPS = $(OBJECTS:$(OBJDIR)/%.o=$(OBJDIR)/%.d)
...
all: ...
...
-include $(DEPS)

Thank you for ignore file, I've merged it to my master.
Author of the SECU-3 project. SECU-3 Engine control unit / Ignition control system
SECU-3.org (Русский)
SECU-3.org (English)
SECU-3 Club ВКонтакте
SECU-3 EMS Project Facebook
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Porting firmware to GCC

Post by Fred »

Thank you for that information! I'll try it next time I get near the keyboard! :-)

Are you loving git? It looks like I'm the ONLY person to have forked and pushed a commit!!! I thought people were contributing to your firmware? They must be doing it in some old fashioned and inefficient way. You should really do a translation of my git sticky (summarised) for your guys so that they can take advantage of it! It makes both their lifes and yours easier and better.

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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Porting firmware to GCC

Post by Fred »

I just had a read up, I might do -MM -MF <file>.d for my setup as it is reasonable to assume that system components are fairly static. Thanks again! :-)
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!
User avatar
STC
LQFP144 - On Top Of The Game
Posts: 2420
Joined: Fri Oct 22, 2010 10:47 pm
Location: Ukraine, Kiev
Contact:

Re: Porting firmware to GCC

Post by STC »

Are you loving git? It looks like I'm the ONLY person to have forked and pushed a commit!!!
Yes, I am. And you are only person who have forked it :-) (unfortunately)
translation of my git sticky (summarised) for your guys so that they can take advantage of it!
Did you mean that topic viewtopic.php?f=41&t=547 ?
Author of the SECU-3 project. SECU-3 Engine control unit / Ignition control system
SECU-3.org (Русский)
SECU-3.org (English)
SECU-3 Club ВКонтакте
SECU-3 EMS Project Facebook
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Porting firmware to GCC

Post by Fred »

That is a damn shame man! :-(

You could be pushy with them and tell them all future work HAS to come via git, or you don't want it. But that could backfire.

And yes, that is the thread. The colourful diagrams are the key points, and the narative that goes with them. Feel free to copy and insert cyrilic words there! :-)

I'll tell you what, I'll do a thread in your support and you can translate it for them to read.

EDIT: Done: viewtopic.php?f=52&t=1325

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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Porting firmware to GCC

Post by Fred »

I also need the -MT option due to my multi stage compilation process.

Code: Select all

m68hc11-gcc -MM -MF init.d -MT preprocessedc/init.pp.c init.c
And I need to automate that from the list of source files, however this is awesome! :-) Thanks.
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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Porting firmware to GCC

Post by Fred »

Done and pushed, thank you so much for the inspiration, it is now 9 lines shorter and MUCH better :-)

Mine is a little fancier, you might want to check out the dependencies on headers by the dependency files part.

https://github.com/fredcooke/freeems-va ... 62720920a8

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!
User avatar
STC
LQFP144 - On Top Of The Game
Posts: 2420
Joined: Fri Oct 22, 2010 10:47 pm
Location: Ukraine, Kiev
Contact:

Re: Porting firmware to GCC

Post by STC »

Inspiration is very important for open source projects :-)
Author of the SECU-3 project. SECU-3 Engine control unit / Ignition control system
SECU-3.org (Русский)
SECU-3.org (English)
SECU-3 Club ВКонтакте
SECU-3 EMS Project Facebook
User avatar
STC
LQFP144 - On Top Of The Game
Posts: 2420
Joined: Fri Oct 22, 2010 10:47 pm
Location: Ukraine, Kiev
Contact:

Re: Porting firmware to GCC

Post by STC »

On the last week I've improved source code of the firmware. Now it can be compiled using old versions of GCC, for instance AVR-GCC 3.4.6.
Author of the SECU-3 project. SECU-3 Engine control unit / Ignition control system
SECU-3.org (Русский)
SECU-3.org (English)
SECU-3 Club ВКонтакте
SECU-3 EMS Project Facebook
Post Reply