Trouble Updating AVRCam Embedded Software

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

Trouble Updating AVRCam Embedded Software

Postby Guest » Sat Feb 05, 2005 3:07 pm

Hi,

I've been trying to update the embedded software on my AVRCam, and I seem to be hitting a problem in the makefile. Attached below is the output when I type "make program". It seems to erase the device properly, but it can't upload the new files. It says that "-i" is not a recognized command-line option. I'm running AVRDude version 4.4.0. According to the documentation, I think I should be using a "-U" option. It says to use -U to "perform a memory operation, equivalent to specifing the '-m', '-i' or '-o', and '-f' options", but it doesn't list these other options anywhere to compare them; "-U" also seems to be a fairly complicated option. Could it be that they changed the options in this release but didn't finish updating the docs? I'm not very experienced yet with using AVRDude; does anyone know how I should update my makefile?

- Bob

----------------------------------

C:\WINDOWS\Desktop\AVRcam_rel_1_4>make program
avrdude -p atmega8 -P lpt1 -c stk200 -e

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9307
avrdude: erasing chip

avrdude done. Thank you.

avrdude -p atmega8 -P lpt1 -c stk200 -i AVRcam.hex
avrdude: unknown option -- i
Usage: avrdude [options]
Options:
-p <partno> Required. Specify AVR device.
-C <config-file> Specify location of configuration file.
-c <programmer> Specify programmer type.
-D Disable auto erase for flash memory
-P <port> Specify connection port.
-F Override invalid signature check.
-e Perform a chip erase.
-U <memtype>:r|w|v:<filename>[:format]
Memory operation specification.
Multiple -U options are allowed, each request
is performed in the order specified.
-n Do not write anything to the device.
-V Do not verify.
-t Enter terminal mode.
-E <exitspec>[,<exitspec>] List programmer exit specifications.
-v Verbose output. -v -v for more.
-q Quell progress output.
-? Display this usage.

avrdude project: <URL:http://savannah.nongnu.org/projects/avrdude>

C:\WINDOWS\Desktop\AVRcam_rel_1_4>
Guest
 

Postby Guest » Sat Feb 05, 2005 5:03 pm

I just downloaded new firmware to a board to see what the output looked like. Here it is:

    avrdude -p atmega8 -P lpt1 -c stk200 -e

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% -0.00s

    avrdude: Device signature = 0x1e9307
    avrdude: erasing chip

    avrdude done. Thank you.

    avrdude -p atmega8 -P lpt1 -c stk200 -i AVRcam.hex

    avrdude: WARNING: the -f, -i, -I, -o, and -m options are deprecated.
    Please use the -U option instead.

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude: Device signature = 0x1e9307
    avrdude: reading input file "AVRcam.hex"
    avrdude: input file AVRcam.hex auto detected as Intel Hex
    avrdude: writing flash (4270 bytes):

    Writing | ################################################## | 100% 2.09s

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

    Reading | ################################################## | 100% 1.42s

    avrdude: verifying ...
    avrdude: 4270 bytes of flash verified

    avrdude done. Thank you.


    > Process Exit Code: 0


It appears as though the erase command I am using is identical to yours, as well as the actual command to write to the flash. The only thing that is different is that I am using avrdude 4.2.0 instead of 4.4. In short, I'm not exactly sure what changed in version 4.4 of avrdude.

I'll poke around a little and see what I can find. The guy that wrote avrdude (Brian Dean) is very supporting of the open-source AVR world, so an answer should be easy to find. Stay tuned...
Guest
 

Postby Guest » Sat Feb 05, 2005 5:22 pm

Ok...here is what the avrdude command should look like for using the -U command line options with version 4.4 of avrdude:

avrdude -p atmega8 -P lpt1 -c stk200 -U flash:w:AVRcam.hex

It appears as though the -U command line option actually is quite powerful, allowing the user to specify which memories to write (flash, EEPROM). In this case, it is only writing the AVRcam.hex file to flash. I think the EEPROM is not being written, but I could be wrong about that.

Give it a try Bob, and let us know if it works.
Guest
 

Postby Guest » Sun Feb 06, 2005 12:17 pm

Hi,

I updated my makefile, and it worked. Here's what I changed to:

--------------

Code: Select all
# Program the device.  The magic trickery below examines the .eep hex
# file whether the size is > 0, and if so, reprograms the EEPROM as
# well.  Just delete these lines if you don't want this feature (like
# on the ATmegas with the EESAVE fuse bit set).
program: $(TARGET).hex $(TARGET).eep
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_ERASE)
        $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(TARGET).hex
        @$(SIZE) --target=$(FORMAT) $(TARGET).eep | while read line; \
        do \
            set -- $$line; \
            if [ "x$$1" != "x0" ] ; then continue; fi; \
            if [ "$$2" -ne 0 ] ; then \
               echo $(AVRDUDE) $(AVRDUDE_FLAGS) -U eeprom:w:$(TARGET).eep; \
               $(AVRDUDE) $(AVRDUDE_FLAGS) -U eeprom:w:$(TARGET).eep; \
               break; \
            fi; \
        done
-------------

The changes are to lines 263, 269, and 270 of the original file. I ran "make program" and got the attached output. I also fired the AVRCam up, and it worked properly, reported that the software version is 1.4. Thanks for your help.

- Bob

-------------------------

Code: Select all
C:\WINDOWS\Desktop\AVRcam_rel_1_4>make program
avrdude -p atmega8 -P lpt1                       -c stk200 -e

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9307
avrdude: erasing chip

avrdude done.  Thank you.

avrdude -p atmega8 -P lpt1                       -c stk200 -U flash:w:AVRcam.hex


avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "AVRcam.hex"
avrdude: input file AVRcam.hex auto detected as Intel Hex
avrdude: writing flash (4542 bytes):

Writing | ################################################## | 100% 3.62s

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

Reading | ################################################## | 100% 3.07s

avrdude: verifying ...
avrdude: 4542 bytes of flash verified

avrdude done.  Thank you.


C:\WINDOWS\Desktop\AVRcam_rel_1_4>
[/code]
Guest
 


Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 8 guests

cron