Page 1 of 14

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

Posted: Thu May 26, 2011 11:22 am
by STC
(Porting firmware to GCC)
Этот вопрос уже давно обсуждался, у меня просто пока нет времени это сделать. Было бы хорошо если бы удалось портировать код для сборки компилятором GCC. При этом попробовать оставить совместимость с IAR.

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

Posted: Thu May 26, 2011 1:19 pm
by DGrees
А для чего это нужно? ИАР вроде весчь хорошая.

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

Posted: Thu May 26, 2011 2:10 pm
by Serj_K
Во-первых проект "секу" - это открытый проект, а иар - проприетарный.
Во-вторых - GCC вроде больше соответствует стандартам языка С.
Ну и расширится база программистов. Не все с иаром работают. Если получится совместимость, то будет хорошо.

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

Posted: Thu May 26, 2011 5:00 pm
by DGrees
Serj_K wrote:Во-первых проект "секу" - это открытый проект, а иар - проприетарный.
А ну да, согласен.

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

Posted: Thu May 26, 2011 8:30 pm
by ender11
крайний gcc для avr крут. лично для меня необходимость портирования очевидна. увы, квалификацией необходимой не обладаю.

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

Posted: Sun May 29, 2011 1:05 pm
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.

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

Posted: Sun May 29, 2011 4:36 pm
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!

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

Posted: Sun May 29, 2011 6:13 pm
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.

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

Posted: Sun May 29, 2011 6:14 pm
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.

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

Posted: Thu Jun 02, 2011 8:41 am
by JOleg
Уже начал. Но я самоучка поэтому нуждаюсь иногда в совете (подсказке).