реклама на сайте
подробности

 
 
> avr-gcc баг?, Неправильно пишутся uint16_t в нижнюю часть IO ATXmega
Непомнящий Евген...
сообщение May 26 2011, 08:30
Сообщение #1


Знающий
****

Группа: Свой
Сообщений: 771
Регистрация: 16-07-07
Из: Волгодонск
Пользователь №: 29 153



Код
uint16_t x = *(volatile uint16_t*)(0);
31a:    80 b1           in    r24, 0x00; 0
31c:    91 b1           in    r25, 0x01; 1
31e:    89 83           std    Y+1, r24; 0x01
320:    9a 83           std    Y+2, r25; 0x02
  *(volatile uint16_t*)(0) = 0;
322:    10 b8           out    0x00, r1; 0
324:    10 b8           out    0x00, r1; 0  // **************  Вместо адрес 1 повторно пишется адрес 0
  *(volatile uint32_t*)(0) = 0;
326:    10 92 00 00     sts    0x0000, r1
32a:    10 92 01 00     sts    0x0001, r1
32e:    10 92 02 00     sts    0x0002, r1
332:    10 92 03 00     sts    0x0003, r1
  *(volatile uint16_t*)(100) = 0;
336:    10 92 64 00     sts    0x0064, r1
33a:    10 92 65 00     sts    0x0065, r1
  *(volatile unsigned int*)(0) = 0;
33e:    10 b8           out    0x00, r1; 0
340:    10 b8           out    0x00, r1; 0


Почему то не работает запись двухбайтовых целыми, расположенных в нижней части IO.
4-байтовые целые работают. Чтение тоже работает нормально.

Тулчайн взял от Avr studio 5 beta.

Опции компиляции:

Код
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -g -c -std=gnu++0x -mmcu=atxmega128a1 -Wall -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-parameter -Os
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 27th July 2025 - 01:09
Рейтинг@Mail.ru


Страница сгенерированна за 0.01329 секунд с 7
ELECTRONIX ©2004-2016