Menu

Flashforth 5.0 on ATmega328p Xplained-min

2016-10-12
2016-10-12
  • Randall Young

    Randall Young - 2016-10-12

    Howdy all,

    I thought this would be a quick install... but as I am updated to AVRdude 6.3, on Ubuntu 16.04, to get support for the mEDBG programming/debugging interface... when I execute...

    rasyoung@ubuntua10:~/Reserve/FlashForth/flashforth-code-283ac4f6c9d62457d8a9f812359f111ebbf3ca0f/avr/hex$ sudo avrdude -p m328p -c xplainedmini  -e -u -U flash:
    w:ff_uno.hex:i -U efuse:w:0x07:m -U hfuse:w:0xda:m -U lfuse:w:0xff:m
    avrdude: usbdev_open(): WARNING: failed to set configuration 1: could not set config 1: Device or resource busy
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.05s
    
    avrdude: Device signature = 0x1e950f (probably m328p)
    avrdude: erasing chip
    avrdude: reading input file "ff_uno.hex"
    avrdude: writing flash (32542 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude: 32542 bytes of flash written
    avrdude: verifying flash memory against ff_uno.hex:
    avrdude: load data flash data from input file ff_uno.hex:
    avrdude: input file ff_uno.hex contains 32542 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: verifying ...
    avrdude: 32542 bytes of flash verified
    avrdude: reading input file "0x07"
    avrdude: writing efuse (1 bytes):
    
    Writing | ################################################## | 100% 0.03s
    
    avrdude: 1 bytes of efuse written
    avrdude: verifying efuse memory against 0x07:
    avrdude: load data efuse data from input file 0x07:
    avrdude: input file 0x07 contains 1 bytes
    avrdude: reading on-chip efuse data:
    
    Reading | ################################################## | 100% 0.01s
    
    avrdude: verifying ...
    avrdude: verification error, first mismatch at byte 0x0000
             0xff != 0x07
    avrdude: verification error; content mismatch
    
    avrdude done.  Thank you.
    

    It chokes setting the fuse bits I believe. Quick search on Google suggests this may be benign, I guess trying to write un-implmented fuse bits, but I am still confused.

    I get a a garbled response to the terminal.

    Any suggestions?

    Thanks

    Randy

     

    Last edit: Randall Young 2016-10-12
  • Mikael Nordman

    Mikael Nordman - 2016-10-12

    Here is one suggestion
    -U efuse:w:0xff:m

    Some versions of avrdude handle the unused bits of the extended fuse differently when it verifies the bits.
    The newer versions of avrdude reads and verifies the unused high 5 bits as ones.
    Some older version reads and verifies the unused high bits as zeroes.
    Thats the explanation.

    BR Mikael

     

    Last edit: Mikael Nordman 2016-10-12
  • Randall Young

    Randall Young - 2016-10-12

    Thanks!

    That's it exactly ... working like a charm. Fuse settings seems to clobber debugging from Atmel Studio 7, but that is a problem for another day ...

    Here's the correct command line to burn FF 5.0 onto the ATmega328p Xplained-Mini using the prerequisite avrdude 6.3.

    sudo avrdude -p m328p -c xplainedmini  -e -u -U flash:w:ff_uno
    .hex:i -U efuse:w:0xff:m -U hfuse:w:0xda:m -U lfuse:w:0xff:m
    

    Ignore the error, it does work ...

    This tests fine with the Python shell script at 9600 baud. Be sure to use dmesg to determine which comport is assigned. I rigged my own udev rule for this board.

    # /etc/udev/rules.d/99-avrprogrammer.rules
    #
    # Udev rules to make AVR programmers user-accessible
    #Atmel ATmega328p Xplained Mini
    SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb",ATTRS{idProduce}=="2145",GROUP="users", MODE="0666"
    

    Best,

    R.

     

    Last edit: Randall Young 2016-10-12

Log in to post a comment.