From: <pao...@fa...> - 2011-07-26 13:10:28
|
Hello guys, I'm trying to build amforth for an ATmega128. It won't compile, searching for a definition of MCUSR. Attached you'll find the folder content I'm using (a standard template). amforth ver. 4.5 AVR Studio 4 (latest build) Any help is greatly appreciated. Thank you |
From: Erich W. <ew....@na...> - 2011-07-26 17:38:33
|
Hello Paolo, On 07/26/2011 03:10 PM, pao...@fa... wrote: > Hello guys, > I'm trying to build amforth for an ATmega128. > It won't compile, searching for a definition of MCUSR. > Attached you'll find the folder content I'm using (a standard template). > amforth ver. 4.5 the attachment seems to be stripped away on the mailing list, but let's see: > make DIR_ATMEL=~/wine/AvrAssembler2 wine ~/wine/AvrAssembler2/avrasm2.exe -I ~/wine/AvrAssembler2/Appnotes2 -I ../../core -I ../../core/devices/atmega128 -fI -v0 -e template.eep.hex -l template.lst template.asm ../../core\macros.asm(49): error: Illegal use of undefined or forward referenced symbol 'MCUSR' in conditional ../../core\macros.asm(57): error: Illegal use of undefined or forward referenced symbol 'MCUSR' in conditional Assembly failed, 2 errors, 0 warnings make: *** [template.hex] Error 1 This is probably, what you see. > grep MCU ~/wine/AvrAssembler2/Appnotes/m128def.inc ;* Target MCU : ATmega128 .equ MCUCR = 0x35 .equ MCUCSR = 0x34 ; MCUCR - MCU Control Register ; MCUCSR - MCU Control And Status Register ; MCUCSR - MCU Control And Status Register yupp, MCUSR is *not* defined in m128def.inc. Poking into the mega32 stuff, which I use a lot, I find a suspicious looking line here (last line): > grep MCU ~/wine/AvrAssembler2/Appnotes/m32def.inc ;* Target MCU : ATmega32 .equ MCUCR = 0x35 .equ MCUCSR = 0x34 ; MCUCR - General Interrupt Control Register ; MCUCSR - MCU Control And Status Register ; MCUCR - MCU Control Register ; MCUCSR - MCU Control And Status Register .equ MCUSR = MCUCSR ; For compatibility So adding that to m128def.inc, it changes the error message: > make DIR_ATMEL=~/wine/AvrAssembler2 wine ~wine/AvrAssembler2/avrasm2.exe -I ~/wine/AvrAssembler2/Appnotes2 -I ../../core -I ../../core/devices/atmega128 -fI -v0 -e template.eep.hex -l template.lst template.asm ../../core\words/store-i_nrww.asm(114): error: Operand 2 out of range: 0x68 ../../core\words/store-i_nrww.asm(122): error: Operand 1 out of range: 0x68 Assembly failed, 2 errors, 0 warnings make: *** [template.hex] Error 1 Hmm. That I haven't seen before. The lines in question both mention SPMCSR: 114: in temp1, SPMCSR 122: out SPMCSR,temp0 SPMCSR = $68, says the datasheet. So maybe "in" and "out" are out of range for $68. Anyone else knows about this? Cheers, Erich |
From: Matthias T. <mt...@we...> - 2011-07-26 17:40:45
|
Hi Paolo, > I'm trying to build amforth for an ATmega128. A rather old controller. Are you sure that its not a more modern one? I vaguly remember reading about troubles with some Atmega103 compatability fuses as well (not related with amforth on avrfreaks.net). > It won't compile, searching for a definition of MCUSR. Some googling told me (AVR Note AVR097: Migration between ATmega128 and ATmega1281/ATmega2561) that the name of the MCUSR was MCUCSR. Thus put a quick .equ MCUSR = MCUCSR inside your template.asm. The exact placement should not be important, but if in doubt put this instruction into the first line. Another thing are the IN instructions in words/core/store-i_nrww.asm. Change all IN instructions into in_ (with the underscore) to make the assembler happy. The reason is that the MCUSR is usually inside the address region that the IN instruction can reach, only on your controller it is outside. The IN_ macro has some checks to decide between IN and a LDS for a particular address. Tell if it works, I cannot test it myself. Then I can make a more permanent change in the repository. Matthias |
From: david j. <dav...@ea...> - 2011-07-27 21:40:19
|
Hi Paulo, I did get amforth running on a mega128 and took notes on the changes needed. Unfortunately I will not have access to my files till mid August. If you are still stuck after the 9 Aug, get in touch. Cheers, David Jeffrey. "pao...@fa..." <pao...@fa...> wrote: >Hello guys, >I'm trying to build amforth for an ATmega128. >It won't compile, searching for a definition of MCUSR. >Attached you'll find the folder content I'm using (a standard >template). >amforth ver. 4.5 >AVR Studio 4 (latest build) > >Any help is greatly appreciated. >Thank you > >------------------------------------------------------------------------------ >Magic Quadrant for Content-Aware Data Loss Prevention >Research study explores the data loss prevention market. Includes >in-depth >analysis on the changes within the DLP market, and the criteria used to >evaluate the strengths and weaknesses of these DLP solutions. >http://www.accelacomm.com/jaw/sfnl/114/51385063/ >_______________________________________________ >Amforth-devel mailing list for http://amforth.sf.net/ >Amf...@li... >https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Paolo G. <pao...@fa...> - 2011-09-01 15:45:47
|
Yes Jeffrey, I still have problems with ATMega128. Could you please post your settings. Thanks. Paolo ----- Original Message ----- From: "david jeffrey" <dav...@ea...> To: "Everything around amforth" <amf...@li...>; <amf...@li...> Sent: Thursday, July 28, 2011 7:34 AM Subject: Re: [Amforth] amforth 4.5 and ATmega128 > Hi Paulo, > > I did get amforth running on a mega128 and took notes on the changes > needed. Unfortunately I will not have access to my files till mid August. > If you are still stuck after the 9 Aug, get in touch. > > Cheers, David Jeffrey. > > "pao...@fa..." <pao...@fa...> wrote: > >>Hello guys, >>I'm trying to build amforth for an ATmega128. >>It won't compile, searching for a definition of MCUSR. >>Attached you'll find the folder content I'm using (a standard >>template). >>amforth ver. 4.5 >>AVR Studio 4 (latest build) >> >>Any help is greatly appreciated. >>Thank you >> >>------------------------------------------------------------------------------ >>Magic Quadrant for Content-Aware Data Loss Prevention >>Research study explores the data loss prevention market. Includes >>in-depth >>analysis on the changes within the DLP market, and the criteria used to >>evaluate the strengths and weaknesses of these DLP solutions. >>http://www.accelacomm.com/jaw/sfnl/114/51385063/ >>_______________________________________________ >>Amforth-devel mailing list for http://amforth.sf.net/ >>Amf...@li... >>https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > ------------------------------------------------------------------------------ > Got Input? Slashdot Needs You. > Take our quick survey online. Come on, we don't ask for help often. > Plus, you'll get a chance to win $100 to spend on ThinkGeek. > http://p.sf.net/sfu/slashdot-survey > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |