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

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

Moderator: STC

Stranger21
LQFP144 - On Top Of The Game
Posts: 1664
Joined: Fri Jul 01, 2011 2:10 pm
Location: г Уфа

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

Post by Stranger21 »

может новый ИАР тоже стал так считать канстанты ? и поэтому были пропуски ...
WAZ21051 gti 1.7i SECU3Ts + mm1.2.3(1)
ВАЗ21310 1.7i Я7.2 2001г
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 »

teuer а что "integral promotion" разный в разных версиях GCC и отличается от IAR?
Должен быть везде к int. Интересно, я проверю.
Вот статья про это в ИАР http://iar.com/website1/1.0.1.0/1494/1/

Посмотрел несколько мест и нашел только в adc.c (как ты говорил). Что интересно, GCC не реагирует даже если поставить switch(ADMUX(uint8_t)0x07), всегда получаем код для int:
176 0010 87B1 in r24,39-32
177 0012 90E0 ldi r25,lo8(0)
178 0014 8770 andi r24,lo8(7)
179 0016 9070 andi r25,hi8(7)

Строки выделенные красным - лишние
Оптимизатор ИАР-а делает все правильно, в отличии от GCC
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
zazuba
LQFP112 - Up with the play
Posts: 104
Joined: Wed Jul 20, 2011 10:25 am
Location: Rostov-on-Don
Contact:

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

Post by zazuba »

Попытался собрать последнюю прошивку с опциями М16 IAR. Получил ошибку при линковке:

IAR Universal Linker V4.60E/386
Copyright 1987-2006 IAR Systems. All rights reserved.
Error[e16]: Segment NEAR_Z (size: 0x491 align: 0) is too long for segment definition. At least 0xc7 more bytes needed. The problem occurred while processing the segment placement command "-Z(DATA)NEAR_I,NEAR_Z=60-45F", where at the moment of placement the available memory ranges were "DATA:96-45f"
Reserved ranges relevant to this placement:
DATA:60-45f NEAR_I

Значит, что места уже не хватает в М16? Или я что-то делаю неправильно?

(М32 IAR - собралась без ошибок)
GAZ 2410
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 »

Если компилировать прошивку для ATmega16 с опцией REALTIME_TABLES, то места в ОЗУ не хватает.
вот строчка с опциями в Makefile:
CFLAGS += -DLITTLE_ENDIAN_DATA_FORMAT -DREALTIME_TABLES
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
zazuba
LQFP112 - Up with the play
Posts: 104
Joined: Wed Jul 20, 2011 10:25 am
Location: Rostov-on-Don
Contact:

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

Post by zazuba »

Спасибо. Вот прошивка для М16
Собрана с опциями: VPSEM, COIL_REGULATION, COOLINGFAN_PWM в IAR 4.21a
Attachments
secu-3_app.zip
(17.17 KiB) Downloaded 412 times
GAZ 2410
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 »

Я раньше говорил что для сборки при помощи IAR вам нужно ставить WinAVR, так как в его составе есть необходимая утилита make.exe. Этого можно не делать так как эта утилита есть отдельно. Ее можно скачать например тут ftp://ftp.equation.com/make/32/make.exe или тут http://gnuwin32.sourceforge.net/packages/make.htm
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
ender11
LQFP112 - Up with the play
Posts: 197
Joined: Sat Dec 11, 2010 4:05 pm

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

Post by ender11 »

WinAVR-20060421 никто не пробовал компилировать?
User avatar
serg_62
TO220 - Visibile
Posts: 14
Joined: Sat Sep 24, 2011 8:04 am

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

Post by serg_62 »

Ребята, помогите новичку собрать прошивку в WinAVR с репозитория ;)
желательно в картинках или где об этом можно почитать ?
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 »

Немного усовершенствовал Makefile-ы. Добавил автоматическую генерацию и проверку зависимостей.
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 »

STC, Please write a sticky letting Russian users know that new users get no posting/pm rights until they are checked. IE, I just found two posts that were held back in here that I didn't see because I don't look often. I need to make you a mod, but put the sticky noting that there could be a delay in the mean time. I'll sticky it, just link me.

Sorry serg_62, didn't mean to cause you problems!

viewtopic.php?f=17&t=1311 - notification in English (STC, you probably need to keep on top of the announcment section and echo important stuff here)

Please tell the Russian speaking guys that they should introduce themselves in this thread:

viewtopic.php?f=54&t=1066

With a note about SEC-3 (if that is why they are here, probably...) otherwise I will likely miss their posts and not authorise them.

Sorry to spam the thread.

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!
Post Reply