mitxela / kiloboot

1kB TFTP Ethernet bootloader for ATmega328P and ENC28J60
52 stars 16 forks source link

avrassembler2.exe under Linux #2

Closed zhurlik closed 5 years ago

zhurlik commented 6 years ago

Hi,

Many thanks for your project. I have started to use it with Arduino Nano v3 and Ethernet Shield - ENC28J60 everything is working fine. I just would like to add how I did it under Linux, that will be interesting for Linux guys to know how to run avrasm2 -fI -o "kiloboot.hex" kiloboot.asm The problem was that I tried all AVR® and Arm® Toolchains (C Compilers) and didn't get successful result.

However it can work via wine:

  1. Extract and copy 2 folders: Atmel\Studio\7.0\toolchain and Atmel\Studio\7.0\Packs under Windows to ~/.wine/drive_c/Program Files (x86)
  2. Then I used wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Atmel/Studio/7.0/toolchain/avr8/avrassembler/avrasm2.exe -fI -o kiloboot.hex -W+ie -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\avrasm\inc" -im328pdef.inc kiloboot.asm -I "c:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avrassembler\Include"

Here is a result from console: ... [.cseg] 0x007c00 0x007ff6 858 156 1014 32768 3.1% [.dseg] 0x000100 0x000346 0 582 582 2048 28.4% [.eseg] 0x000000 0x000000 0 0 0 1024 0.0%

Assembly complete, 0 errors. 0 warnings

Thanks, Vlad

mitxela commented 6 years ago

Hi, thanks. I did some of the development on linux as well. All that's really needed is the .exe file, and the .inc files. I copied those into a directory on my linux machine and then made a simple makefile that looked like this:

asm:
    wine ~/kiloboot/wb/avrasm2.exe -fI -I ~/kiloboot/wb ../repo/kiloboot.asm -o ../repo/kiloboot.hex

flash: asm
    avrdude -c USBASP -p m328p -U flash:w:"kiloboot.hex":i -B10

Then I could just type make flash to assemble and write to the chip. I don't even have AVR studio any more, I've just been copying that folder with the .exe and the include files across machines.

Cheers, Tim

zhurlik commented 6 years ago

Hi, that was my next exercise how to simplify and delete all unneeded files which were copied from Windows. The main problem was that there is no way how to make kiloboot.hex using linux avr tools or probably I didn't find it. For me it works only via avrasm2.exe

Thanks, Vlad

zhurlik commented 6 years ago

@mitxela Thanks a lot again, everything is working for me, you are right it's enough to have just 2 files https://github.com/zhurlik/smart-home/tree/master/arduino/bootloader

twinec commented 5 years ago

@zhurlik close this issue, it's been almost a year...

zhurlik commented 5 years ago

Sure, it can be closed