2017-10-22 14 views
0

리눅스에서 AVR MCU 용으로 간단한 어셈블러 컴파일러를 사용하고 싶습니다. 일반적으로 MCU (AtmelStudio와 같은)의 전체 개발 환경을 선호하지 않습니다. 예 : Linux에서 의 작은 C 프로그램을 작성하여 플래시 모드로 병렬 포트를 통해 바이트를 보내고 ISP 모드에서 AVR 칩 의 eeprom 메모리를 보냈습니다. 이제 리눅스에서 간단한 어셈블러를 찾고 싶습니다. 리눅스에서 win 또는 가상 머신으로 C 컴파일러 나 Atmelstudio 같은 해결 방법을 선호하지 않습니다. 이제 신선한 윤활유 아래 avra을 시험해 보았습니다.avra 어셈블러 - pragma?

apt-get install avra 
avra -l test.lst -o test.hex test.asm 
AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) 
Copyright (C) 1998-2010. Check out README file for more info 

Pass 1... 
/usr/share/avra/tn45def.inc(44) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(48) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(53) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(54) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(646) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(647) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(648) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(649) : PRAGMA directives currently ignored 
Pass 2... 
/usr/share/avra/tn45def.inc(44) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(48) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(53) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(54) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(646) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(647) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(648) : PRAGMA directives currently ignored 
/usr/share/avra/tn45def.inc(649) : PRAGMA directives currently ignored 
done 

Used memory blocks: 
    Data  : Start = 0x0060, End = 0x007F, Length = 0x0020 
    Code  : Start = 0x0000, End = 0x0000, Length = 0x0001 
    Code  : Start = 0x0020, End = 0x0045, Length = 0x0026 

Assembly complete with no errors. 
Segment usage: 
    Code  :  39 words (78 bytes) 
    Data  :  32 bytes 
    EEPROM :   0 bytes 

ls -ltr test.* 
-rw-rw-r-- 1 laci laci 875 okt 21 22:14 test.asm 
-rw-rw-r-- 1 laci laci 0 okt 21 22:15 test.cof 
-rw-rw-r-- 1 laci laci 415 okt 21 22:15 test.obj 
-rw-rw-r-- 1 laci laci 2005 okt 21 22:15 test.lst 
-rw-rw-r-- 1 laci laci 264 okt 21 22:15 test.hex 
-rw-rw-r-- 1 laci laci 13 okt 21 22:15 test.eep.hex 

cat test.hex 
:020000020000FC 
:020000001FC01F 
:100040000FE50DBF01E00EBFF0E0E6E709D0B0E03C 
:10005000A0E6A10F85918C93AA951A95DCF70895D7 
:10006000FF93EF9310E08591803011F01395FBCF53 
:10007000EF91FF910895537472696E6720746F2039 
:0C0080006265207265766572736564002D 
:00000001FF 

그래서 Intel Hex 출력이 오류없이 생성 된 것 같습니다. 그게 단지 PRAGMA 지시어와 관련된 경고 일 뿐이므로 나는 더 복잡한 소스를 위해서 이 컴파일러를 사용할 수 있습니다. 아니면 리눅스에서 AVR mcu를위한 다른 어셈블러를 찾아야 만합니까? 여기 장치 데프 파일에서 일부 문제가 라인 : "/usr/share/avra/tn45def.inc":

#pragma partinc 0 
#pragma AVRPART ADMIN PART_NAME ATtiny45 
#pragma AVRPART CORE CORE_VERSION V2 
#pragma AVRPART CORE NEW_INSTRUCTIONS lpm rd,z+ 
#pragma AVRPART MEMORY PROG_FLASH 4096 
#pragma AVRPART MEMORY EEPROM 256 
#pragma AVRPART MEMORY INT_SRAM SIZE 256 
#pragma AVRPART MEMORY INT_SRAM START_ADDR 0x60 

나는 AVRFREAKS 링크에서 뭔가를 이해하려고 노력 : http://www.avrfreaks.net/forum/problems-attiny261-v2-or-avra-130-osx-update 는 그 아트멜의 모양을 include 파일은 컴파일러가 이해할 수있는 새로운 파일 일 수 있습니다. 리눅스에서 간단한 AVR 어셈블러가 될 수있는 것은 무엇입니까?

+0

'AVR-as'? 어쨌든, 도구를 요구하는 것은 유감스럽게도 정책 때문에 SO라는 주제에서 벗어납니다. – Jester

답변