logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

[AVR Studio] Programowanie z linii poleceń

Piotr_pp 14 Kwi 2010 18:23 3293 8
REKLAMA
  • #1 7960926
    Piotr_pp
    Poziom 12  
    Witam,

    Niedawno zamieściłem temat, apropo użycia programatora MKII z avr dude. Niestety nie uzyskałem praktycznie żadnej odpowiedzi. Teraz chciałem zapytać, czy istnieje techniczna możliwość aby zaprogramować procesor z linii poleceń używając do tego avr studio. Avr dude nie wchodzi w grę, ponieważ nie udało mi się go 'nakłonić' do współpracy z programatorem Avrisp MKII.

    Gdzieś spotkałem się z czymś takim, ale nie pamiętam dokładnie i mogę znaleźć ponownie.

    Będę bardzo wdzięczny za wszelkie posty.
  • REKLAMA
  • #3 7961153
    Piotr_pp
    Poziom 12  
    Ale AVR studio nie zawiera AVRone.. hmm
  • REKLAMA
  • #4 7961181
    ZbeeGin
    Poziom 39  
    Piotr_pp napisał:
    Ale AVR studio nie zawiera AVRone.. hmm

    Zawiera, zawiera. Wejdź sobie do katalogu Program Files/Atmel/AVR Tools i sprawdź co tam jest.
  • #5 7961652
    Piotr_pp
    Poziom 12  
    Rzeczywiście :) Przyznam, że jeszcze nie próbowałem programować. Przy czym pierwsze co mi się rzuciło w oczy to:

    Supported devices:
            ATxmega128A1, ATxmega128A3, ATxmega192A3, ATxmega256A3,
            ATxmega256A3B, ATxmega64A1, ATxmega64A3, ATxmega16A4,
            ATxmega32A4


    A ja chciałbym zaprogramować ATmege 1280.
  • REKLAMA
  • #6 7962245
    tmf
    VIP Zasłużony dla elektroda
    To może spójrz na drugie co ci się rzuci w oczy?

    
    Supported devices:
            ATxmega128A1, ATxmega128A3, ATxmega192A3, ATxmega256A3,
            ATxmega256A3B, ATxmega64A1, ATxmega64A3, ATxmega128D3,
            ATxmega16A4, ATxmega16D4, ATxmega192D3, ATxmega256D3,
            ATxmega32A4, ATxmega32D4, ATxmega64D3, ATmega128A, ATmega164A,
            ATmega164PA, ATmega165PA, ATmega169PA, ATmega16A, ATmega324A,
            ATmega324PA, ATmega329PA, ATmega32A, ATmega644A, ATmega644PA,
            ATmega64A, AT90CAN128, AT90CAN32, AT90CAN64, AT90USB1286,
            AT90USB1287, AT90USB646, AT90USB647, ATmega128, [b]ATmega1280[/b],
            ATmega1281, ATmega1284, ATmega1284P, ATmega128RFA1, ATmega16,
            ATmega162, ATmega164P, ATmega165, ATmega165P, ATmega169,
            ATmega169P, ATmega16U4, ATmega2560, ATmega2561, ATmega32,
            ATmega324P, ATmega325, ATmega3250, ATmega3250P, ATmega325P,
            ATmega329, ATmega3290, ATmega3290P, ATmega329P, ATmega32U4,
            ATmega32U6, ATmega406, ATmega64, ATmega640, ATmega644,
            ATmega644P, ATmega645, ATmega6450, ATmega649, ATmega6490,
            ATmega649P
    Supported devices for ISP mode and oscillator calibration only:
            ATmega168A, ATmega16HVA, ATmega48A, ATmega48PA, ATmega88A,
            ATmega88PA, ATmega8HVA, ATtiny13A, ATtiny2313A, ATtiny24A,
            ATtiny261A, ATtiny44A, ATtiny461A, ATtiny861A, AT90PWM2,
            AT90PWM216, AT90PWM2B, AT90PWM3, AT90PWM316, AT90PWM3B,
            AT90PWM81, AT90USB162, AT90USB82, ATmega168, ATmega168P,
            ATmega16HVA2, ATmega16HVB, ATmega16M1, ATmega16U2, ATmega328,
            ATmega328P, ATmega32C1, ATmega32HVB, ATmega32M1, ATmega32U2,
            ATmega48, ATmega48P, ATmega64C1, ATmega64HVE, ATmega64M1,
            ATmega88, ATmega88P, ATmega8U2, ATtiny13, ATtiny167, ATtiny2313,
            ATtiny24, ATtiny25, ATtiny261, ATtiny4313, ATtiny43U, ATtiny44,
            ATtiny45, ATtiny461, ATtiny48, ATtiny84, ATtiny85, ATtiny861,
            ATtiny87, ATtiny88
    
  • #7 7962711
    Piotr_pp
    Poziom 12  
    A po wywołaniu avrone z parametrem -h:

    
    Usage: avrone.exe [commands] [options]
    Commands:
     -h, -?		Print this help.
     -he		Print exit codes.
     -e[c|e|a|b|u]	Chip erase (-e, -ec). Additional XMEGA commands: erase EEPROM
    		(-ee), erase BOOT section (-eb), erase APP section (-ea),
    		erase user signature (-eu).
     -f <fusebytes>	Write high/low fuse bytes (fuse bytes 1/0 on XMEGA devices).
    		The LSB of fusebytes will be written to the low fuse byte, and
    		the MSB will be written to the high fuse byte.
     -id		Detect interface. If a JTAG daisy chain is detected,
    		instructions on how to set the -D option is printed.
     -j <ID>	Read JTAG ID string. If an optional ID is specified, the
    		program will terminate if the read ID differs.
     -l <lockbyte>	Set the lock byte to the specified value.
     -p[a|f|e|b|u]	Program ALL memories (-pa), FLASH (-pf), EEPROM (-pe), both
    		FLASH and EEPROM (-pb) or user signature (-pu). Requires input
    		files specified with the -ia (ALL), -if (FLASH), -ie (EEPROM)
    		and/or -iu (user signature) options.
     -q		Read all fuse bytes.
     -r[f|e|b|u|p]	Read FLASH (-rf), EEPROM (-re), both (-rb) or user signature
    		(-ru) memories. Requires output files specified with the -of
    		(FLASH), -oe (EEPROM), -ou (user signature) and/or -op
    		(production signature) options.
     -s		Read signature bytes.
     -t		Run emulator self test.
     -u[b|a|e]	Read CRC of BOOT section (-ub), APP section (-ua), or the whole
    		flash (-ue).
     -v[a|f|e|b|u]	Verify ALL memories (-va), FLASH (-vf), EEPROM (-ve), both
    		FLASH and EEPROM (-vb) or user signature (-vu). Requires input
    		files specified with the -ia (ALL), -if (FLASH), -ie (EEPROM)
    		and/or -iu (user signature) options.
     -y		Read lock byte.
     -C[b|a|e] <checksum>
    		Verify CRC of BOOT section (-Cb), APP section (-Ca), or the
    		whole flash (-Ce). If <checksum> is not supplied, it will be
    		calculated from the input file (specified with -if or -ia).
     -E <ext.fuse>	Write extended fuse byte (fuse byte 2 on XMEGA devices).
     -F <fusebytes>	Verify high/low fuse bytes. The LSB of fusebytes will be
    		compared to the low fuse byte, and the MSB will be compared
    		to the high fuse byte.
     -L <lockbyte>	Verify the lock byte.
     -G <ext.fuse>	Verify the extended fuse byte against the given value.
     -XE <fusebytes>
    		Write XMEGA fuse bytes 4 and 5. The LSB of fusebytes will be
    		written to byte 4, and the MSB will be written to byte 5.
     -XV <fusebytes>
    		Verify XMEGA fuse bytes 4 and 5. The LSB of fusebytes will be
    		compared to byte 4, and the MSB will be compared to byte 5.
    
    Options:
     -ae <start>,<end>
    		Specify address range for reading EEPROM memory. Default is
    		entire memory.
     -af <start>,<end>
    		Specify address range for reading FLASH memory. Default is
    		entire memory.
     -c <serial>	Specify serial number of emulator to connect to.
     -d <device>	[required] Specify the type of device.
     -ia <file>	Specify input file (ELF) for programming ALL memories.
     -ie <file>	Specify input file for programming EEPROM memory.
     -if <file>	Specify input file for programming FLASH memory.
     -iu <file>	Specify input file for programming user signature.
     -m[j|p]	Choose programming mode: JTAG (-mj) (default) or PDI (-mp).
     -oe <file>	Specify output file for reading EEPROM memory.
     -of <file>	Specify output file for reading FLASH memory.
     -ou <file>	Specify output file for reading user signature.
     -op <file>	Specify output file for reading production signature.
     -z		No progress indicator. Useful when redirecting output to file.
     -D <devsbefore,devsafter,bitsbefore,bitsafter>
    		Set daisy chain settings. Only available in JTAG mode.
     -D <index>	Set the device's position in the daisy chain. Daisy chain
    		settings will be configured automatically. Only available in
    		JTAG mode.
     -J <speed>	Specify device speed (Hz).
     -R		Apply external reset while programming. Only available in
    		JTAG mode.
    
    Example usage: avrone.exe -d ATxmega128a1 -e -pf -if c:\tmp\test.hex
    
    Supported devices:
    	ATxmega128A1, ATxmega128A3, ATxmega192A3, ATxmega256A3, 
    	ATxmega256A3B, ATxmega64A1, ATxmega64A3, ATxmega16A4, 
    
    	ATxmega32A4
    


    Nie bardzo rozumiem, jak użyć avrone.exe z programatorem avrisp mkII o którym wspominałem w pierwszym poście.

    Rozumiem, że wysłałeś mi helpa z jtagice.exe.
  • REKLAMA
  • #8 7962976
    ZlyDotyk
    Poziom 19  
    Jak sama nazwa wskazuje avrone służy do obsługi avrone. Tobie potrzebny jest stk500.exe.
  • #9 7963123
    __Grzegorz__
    Poziom 30  
    
    @echo off
    
    c:
    cd \Program Files\Atmel\AVR Tools\STK500
    
    :loop
    color f0
    rem Set ISP frequency, Set fuse bytes
    rem M103C     - unprog
    rem WDTON     - unprog
    rem OCDEN     - unprog
    rem JTAGEN    - unprog
    rem SPIEN     - ?
    rem EESAVE    - unprog
    rem BOOTSZ    - Flashsize=2048
    rem BOOTRST   - prog
    rem CKOPT     - unprog
    rem BODLEVEL  - VCC=4.0 V
    rem BODEN     - prog
    rem SUT_CKSEL - Ext. Crystal High Freq.; Start-u time: 16K CK + 64 ms
    Stk500.exe -cUSB -dATmega128 -I125kHz -e -fDA3F -EFF -FDA3F -GFF
    if errorlevel 1 goto :err
    rem Set ISP frequency, Erase, Program device FLASH, Set lock byte
    rem Further programming and verification disabled
    Stk500.exe -cUSB -dATmega128 -I2Mhz -if%1 -pf -vf -lFC -LFC
    if errorlevel 1 goto :err
    
    color f9
    echo "----------------------------------------------------"
    echo "|                                                  |"
    echo "|                PROGRAM SUCCEEDED                 |"
    echo "|                                                  |"
    echo "----------------------------------------------------"
    echo. 
    echo CTRL+C to exit...
    PAUSE
    goto :loop
    
    :err
    color fc
    echo "----------------------------------------------------"
    echo "|                                                  |"
    echo "|              !!! PROGRAM FAILED !!!              |"
    echo "|                                                  |"
    echo "----------------------------------------------------"
    echo.
    echo CTRL+C to exit...
    PAUSE
    goto :loop
    


    Dostosować i stosować :)

    Pod win przeciągasz plik z wsadem (*.hex) na ikonę skryptu (*.cmd)
    - i "samo" się programuje...
REKLAMA