Портирование кода прошивки на GCC (Porting firmware to GCC)

Обсуждение прошивок SECU-3. Discussion of SECU-3 firmware.

Moderator: STC

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

Портирование кода прошивки на GCC (Porting firmware to GCC)

Post by STC »

(Porting firmware to GCC)
Этот вопрос уже давно обсуждался, у меня просто пока нет времени это сделать. Было бы хорошо если бы удалось портировать код для сборки компилятором GCC. При этом попробовать оставить совместимость с IAR.
Last edited by STC on Tue Jul 05, 2011 11:14 am, edited 1 time in total.
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
DGrees
LQFP112 - Up with the play
Posts: 209
Joined: Sun Dec 19, 2010 7:47 pm

Re: Портирование кода прошивки на GCC

Post by DGrees »

А для чего это нужно? ИАР вроде весчь хорошая.
Serj_K
LQFP144 - On Top Of The Game
Posts: 330
Joined: Thu Dec 09, 2010 12:55 pm
Location: Kyiv, Ukraine

Re: Портирование кода прошивки на GCC

Post by Serj_K »

Во-первых проект "секу" - это открытый проект, а иар - проприетарный.
Во-вторых - GCC вроде больше соответствует стандартам языка С.
Ну и расширится база программистов. Не все с иаром работают. Если получится совместимость, то будет хорошо.
DGrees
LQFP112 - Up with the play
Posts: 209
Joined: Sun Dec 19, 2010 7:47 pm

Re: Портирование кода прошивки на GCC

Post by DGrees »

Serj_K wrote:Во-первых проект "секу" - это открытый проект, а иар - проприетарный.
А ну да, согласен.
ender11
LQFP112 - Up with the play
Posts: 197
Joined: Sat Dec 11, 2010 4:05 pm

Re: Портирование кода прошивки на GCC

Post by ender11 »

крайний gcc для avr крут. лично для меня необходимость портирования очевидна. увы, квалификацией необходимой не обладаю.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Портирование кода прошивки на GCC

Post by Fred »

If I can help in any way, let me know! :-)

SECU-3 built by GCC = good for everyone!

Why do you want to maintain compatibility with the old compiler?

I'm sorry for using English, shame on me...

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: Портирование кода прошивки на GCC

Post by STC »

About compatibility.
I am not sure (and I don't know about latest versions of GCC for AVR), I doubt, but it is possible that IAR can generate code better. Anyway, we can test GCC and if it will be good we can absolutely abandon IAR.
Test will show!
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: Портирование кода прошивки на GCC

Post by Fred »

In my opinion, as long as the code generated is error-free, a slight loss of efficiency is a small price to pay for a much wider network of potential developers, especially if you eventually complete and polish all of the translations! :-)

Also, depending upon IAR, there may be code layout improvements available. EG, in Code Warrior for HCS12 you must declare all vars at the top of each function, whereas in GCC you can reduce the scope and declare them more locally.

Casting requirements sometimes vary, also. With GCC being fairly strict with the rules, usually, and some others being broken/relaxed.

Just a few things to keep in mind.

If you can make the code itself portable, and extract the compiler specific stuff (such as pragmas) into macros, then you may very well be able to keep it building fine under both.

Again, sorry for the English, but I felt that I had something to add, I hope you and your men don't mind too much.

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: Портирование кода прошивки на GCC

Post by Fred »

Also, you may wish to implement some form of unit testing or integration testing BEFORE migrating code to the new compiler such that you can prove that it doesn't break. It's a lot of effort, but well worth the quality improvement, I think.

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!
JOleg
QFP80 - Contributor
Posts: 89
Joined: Mon Dec 20, 2010 10:40 am

Re: Портирование кода прошивки на GCC

Post by JOleg »

Уже начал. Но я самоучка поэтому нуждаюсь иногда в совете (подсказке).
Post Reply