User Tools

Site Tools


opendcc-flash-en

OpenDCC Flash Eeprom

ContentCommand StationsOpenDCC



opendcc.jpg Flash firmware running Ubuntu.


Needed packages

  • avr-gcc
  • avr-libc
  • avrdude


Preparing sources 0.16

  • Unpack the OpenDCC sources with unzip¹
  • Change in Makefile avr-gcc.exe in avr-gcc
  • Change line 100 in @avr-size ${TARGET}

¹) Zip password must be requested by email, see footnote at bottom of http://opendcc.de/elektronik/opendcc/download.html


Choosing parser

  • Set the wanted parser in the config.h
#define PARSER  INTELLIBOX  // LENZ: behave like a LI101
                            // INTELLIBOX: behave like a IBOX


Build

cd default
make

Flash

Before switching on OpenDCC press the STOP button and keep pressed. Instead of the normal mode of operation now a boot loader is started (recognizably by the continuousbright CTRL LED), which waits now for a new software from the PC. This software will be loaded to the internal non volatile memory of OpenDCC.

Atmega32

avrdude -pm32 -cavr109 -P/dev/ttyUSB0 -b19200 -Uflash:w:OpenDCC.hex:a -Ueeprom:w:OpenDCC.eep:a

ATMEGA644P (linux)

avrdude -F -pm644 -cavr109 -P/dev/ttyUSB0 -b19200 -Uflash:w:OpenDCC_XP.hex:a -Ueeprom:w:OpenDCC_XP.eep:a 

Sample session

Connecting to programmer: .
Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 1.5; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x7f

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9502
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: current erase-rewrite cycle count is -11272448 (if being tracked)
avrdude: erasing chip
avrdude: reading input file "OpenDCC.hex"
avrdude: input file OpenDCC.hex auto detected as Intel Hex
avrdude: writing flash (19974 bytes):

Writing | ################################################## | 100% 11.88s



avrdude: 19974 bytes of flash written
avrdude: verifying flash memory against OpenDCC.hex:
avrdude: load data flash data from input file OpenDCC.hex:
avrdude: input file OpenDCC.hex auto detected as Intel Hex
avrdude: input file OpenDCC.hex contains 19974 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 11.26s



avrdude: verifying ...
avrdude: 19974 bytes of flash verified
avrdude: reading input file "OpenDCC.eep"
avrdude: input file OpenDCC.eep auto detected as Intel Hex
avrdude: writing eeprom (168 bytes):

Writing | ################################################## | 100% 2.71s



avrdude: 168 bytes of eeprom written
avrdude: verifying eeprom memory against OpenDCC.eep:
avrdude: load data eeprom data from input file OpenDCC.eep:
avrdude: input file OpenDCC.eep auto detected as Intel Hex
avrdude: input file OpenDCC.eep contains 168 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 0.11s



avrdude: verifying ...
avrdude: 168 bytes of eeprom verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

opendcc-flash-en.txt · Last modified: 2018/11/12 08:56 (external edit)