From: Marcin C. <sa...@sa...> - 2010-08-15 20:23:42
|
Hello, as the FreeBSD user I decided to give avra a try. It was necessary to add some patches to the assembler and one dubious change to amforth, but it works very well, and even .hex files are the same when produced by avra and the Atmel tool. I have posted patches to the newest avra (trunk, they might work with 1.3.0 release) on Sourceforge: 3044547 Error:: ldi can only use a high register (r16 - r31) https://sourceforge.net/tracker/?func=detail&aid=3044547&group_id=55499&atid=477233 3044545 movw y, z causes Error:: No register associated with y and z https://sourceforge.net/tracker/?func=detail&aid=3044545&group_id=55499&atid=477233 3044541 .ifndef does not work (Can't redefine constant, use .SET) https://sourceforge.net/tracker/?func=detail&aid=3044541&group_id=55499&atid=477233 As per suggestion I am using Atmel include files taked from the latest AVR Studio (I place them in /usr/local/libdata/avra and modify avr-build.xml accordingly). The only (trivial) issue left is that avra checks all code ranges produced by the assembler and complains if overlap occurs. Atmel assembler does not care and happily produces two lines in HEX file for the same range. This happens when the serial rx or tx via IRQ is enabled, core/devices/atmega328p/device.asm produces: .org $024 rcall isr ; USART Rx Complete .org $026 rcall isr ; USART, Data Register Empty and core/drivers/usart-isr-[rt]x.asm produce: .org URXCaddr (or .org UDREaddr) jmp_ usart_rx_isr I have enclosed a silly patch (irq.patch) that encloses them info .ifdefs to avoid producing overlapping assembly. I am not sure this is the right way to handle it, though. Enclosed please find also patches to solve flash size exceeded problem when producing .hex files for arduino. One question by the way: At amforth_interpreter (0x3800 in case of 328p) we start the inner interpreter (label DO_DODOES). Wouldn't that make sense to to have an additional "jmp_ amforthstart" there as well? This would probably allow booting Amforth independent of the BOOTRST fuse setting. And finally, there is a patch attached for ant files to call avra. I am flashing one Arduino board (ATmega 328p Duemilanove) with another one (ATmega168 Freeduino) via In-circuit Serial Programming. --Marcin |