Difference between revisions of "Quick Start Guide/Flashing"

From Ethersex_Wiki
Jump to: navigation, search
(AVRDUDE and menuconfig)
(AVRDUDE in makefile and menuconfig)
Line 37: Line 37:
 
'''/* PAGE UNDER CONSTRUCTION */'''
 
'''/* PAGE UNDER CONSTRUCTION */'''
  
Since PR #251 the e6 makefile supports two new targets, <tt>program</tt> and <tt>fuses</tt>, to invoke avrdude. The target <tt>program</tt> calls avrdude with the options to flash the previously compiled <tt>ethersex.hex</tt> to the MCU. The <tt>fuses</tt> Target may be used to program the MCUs fuse registers.
+
Since commit [https://github.com/ethersex/ethersex/commit/16c2a388ec775b51c049db1eeff3a8171c6ad71b 16c2a388ec] the [[Ethersex]] makefile supports two new targets, ''program'' and ''fuses'', to invoke avrdude. The target ''program'' calls avrdude with the options to flash the previously compiled ''ethersex.hex'' to the MCU. The ''fuses'' target may be used to program the MCUs fuse registers.
  
 
<!-- REM: Note MCU/Freq settings has to be configured first. -->
 
<!-- REM: Note MCU/Freq settings has to be configured first. -->
Line 43: Line 43:
 
== AVRDUDE Configuration ==
 
== AVRDUDE Configuration ==
  
If - and only if - the avrdude executable could be found in your <tt>PATH</tt>, menuconfigs mainmenu will show an option to enter AVRDUDE configuration:
+
If - and only if - the avrdude executable could be found in your ''PATH'', menuconfigs mainmenu will show an option to enter AVRDUDE configuration:
  
 
[[File:avrdude_mainmenu.png]]
 
[[File:avrdude_mainmenu.png]]
Line 60: Line 60:
 
;Port
 
;Port
 
:avrdude option '-P'.
 
:avrdude option '-P'.
:Specify the port the programmer is connected to. Serial devices like ponyprog use for example <tt>/dev/ttyS0</tt> (= COM1 under Windows!), most modern programmers use <tt>usb</tt>.
+
:Specify the port the programmer is connected to. Serial devices like ponyprog use for example ''/dev/ttyS0'' (= COM1 under Windows!), most modern programmers use ''usb''.
 
:
 
:
 
: Note that most old-style serial programmers will not work properly when connected to an USB-serial-Adapter!
 
: Note that most old-style serial programmers will not work properly when connected to an USB-serial-Adapter!

Revision as of 07:06, 16 July 2013

Requirements

  • the previously selected board, e.g. AVR NET-IO, ready built and (hopefully) tested
  • an ISP-Programmer of your choice supported by avrdude
  • ISP connector cable

Flashing with avrdude

Avrdude offers several options. We will look on the most important, to make basic flashing of ethersex possible.

  • The chip you use, should be m32 for the ATMega32 in most cases: -p m32
  • Debug messages: -v
  • The protocol spoken with the programmer, for the Evaluation-Board: -c ponyser
  • The serial port the programmer is connected to: -P /dev/ttyS0
  • The command you want to execute: -U flash:w:ethersex.hex

After you checked all options and adjusted them to your settings you should have a command like this:

 avrdude -v -p m32 -c ponyser -P /dev/ttyS0 -U flash:w:ethersex.hex

Writing the Bytes

  • Disconnect the power from the NET-IO
  • Connect your ISP cable to the programmer and the Net-IO
  • Reconnect the power and connect your programmer to the PC
  • Execute the command you assembled earlier
  • Congratulations! If avrdude finished without any error you successfully flashed ethersex to your Net-IO!
  • Disconnect the power and the programmer from the Net-IO
  • Reconnect the power, your Net-IO should boot up with ethersex

AVRDUDE in makefile and menuconfig

/* PAGE UNDER CONSTRUCTION */

Since commit 16c2a388ec the Ethersex makefile supports two new targets, program and fuses, to invoke avrdude. The target program calls avrdude with the options to flash the previously compiled ethersex.hex to the MCU. The fuses target may be used to program the MCUs fuse registers.


AVRDUDE Configuration

If - and only if - the avrdude executable could be found in your PATH, menuconfigs mainmenu will show an option to enter AVRDUDE configuration:

Avrdude mainmenu.png

Avrdude menu.png

The AVRDUDE configuration page allows to setup the most common options for avrdude:

Programmer Type
avrdude option '-c'.
Use the programmer configuration choosen from the list.
Refer to the official avrdude documentation if you're in doubt about the correct choice for your programmer (avrdude home).
NB: The list of choices is generated by calling 'avrdude -c ?' and contains all the programmers your avrdude executable supports.
Port
avrdude option '-P'.
Specify the port the programmer is connected to. Serial devices like ponyprog use for example /dev/ttyS0 (= COM1 under Windows!), most modern programmers use usb.
Note that most old-style serial programmers will not work properly when connected to an USB-serial-Adapter!
Extra verbose output
avrdude option '-v -v'.
Be more verbose. Default is '-v'. Use this, if you experience problems while flashing or simply want to see in detail whats going on...
Do NOT verify after programming
avrdude option '-V'.
Do NOT verify flash memory after programming. Use with care and only if you're really sure that your setup is perfect. Speeds things up a bit but it's use is generally discouraged.
Count # of erase cycles in EEPROM
avrdude option '-y'.
Tell avrdude to maintain an erase cycle counter in the last four bytes of the eeprom. The counter has to be initialized by calling avrdude with the option '-Y 1' once.
Do not use this option if your e6 configuration uses the last four bytes of the eeprom.
Bitclock for ISP or JTAG
Pass extra options to avrdude

AVR Fuses

BIG FAT WARNING!

previous step |