AVRDUDE ATXMega128 programming reliability on Ubuntu

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your time in advance.

 

I have very little experience of the AVR products and tools (so please bear with me) but have just started in a new company which (so far) exclusively uses the Atmel microcontrollers. Also my first post so not sure if I've posted on the best forum.

 

So the issue I have is related to using AVRDUDE to program a ATXMega128A1U (very mature) product using the Olimex AVR-ISP-MK2. What I experience is unreliable programming - i'd say 50% of the time (and I've run the programming operation many times on several units) the programming just fails at some point in the operation and I need to disconnect+reconnect the Olimex USB before retrying. So c.50% of the time it works fine, the other 50% it goes so far and then just falls over in a heap.

 

The programming script is run from a makefile project on an Ubuntu VirtualBox machine (windows host). AVRDUDE v6.3, Ubuntu 18.04.4 LTS.

 

A typical failed output looks like;

make program
/usr/bin/avrdude -p atxmega128a1 -P usb  -c avrispmkII -vv -B 8 -e -U flash:w:tpm_lib.out.hex   -U fuse2:w:0xfe:m -U fuse4:w:0xfe:m -U fuse5:w:0xe2:m  

avrdude: Version 6.3
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/mcrookes/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
         Setting bit clk period        : 8.0
avrdude: usbdev_open(): Found AVRISP mkII, serno: 296977225736
Using p = 8.00 us for SCK (param = 6)
avrdude: Skipping parameter write; parameter value already set.
         AVR Part                      : ATxmega128A1
         Chip Erase delay              : 0 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 0
         StabDelay                     : 0
         CmdexeDelay                   : 0
         SyncLoops                     : 0
         ByteDelay                     : 0
         PollIndex                     : 0
         PollValue                     : 0x00
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           prodsig        0     0     0    0 no         50   50      0     0     0 0x00 0x00
           fuse1          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse2          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse4          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse5          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0     0     0 0x00 0x00
           data           0     0     0    0 no          0    0      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no       2048   32      0     0     0 0x00 0x00
           application    0     0     0    0 no     131072  512      0     0     0 0x00 0x00
           apptable       0     0     0    0 no       8192  512      0     0     0 0x00 0x00
           boot           0     0     0    0 no       8192  512      0     0     0 0x00 0x00
           flash          0     0     0    0 no     139264  512      0     0     0 0x00 0x00
           usersig        0     0     0    0 no        512  512      0     0     0 0x00 0x00
           fuse0          0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 0
         Firmware Version Master : 1.41
         Vtarget         : 3.3 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e974c (probably x128a1u)
avrdude: erasing chip
avrdude: reading input file "tpm_lib.out.hex"
avrdude: input file tpm_lib.out.hex auto detected as Intel Hex
avrdude: writing flash (120218 bytes):

Writing | ########                                           | 15% 2.57savrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x06
avrdude: stk500v2_loadaddr(): failed to set load address
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_recv_frame(): usb_bulk_read(): could not detach kernel driver from interface 0: No data available
avrdude: stk500v2_recv_mk2: error in USB receive
^[[D^[[A^CMakefile:769: recipe for target 'program' failed
make: *** [program] Interrupt

Note - Ctrl+C used to terminate at the end of the snippet

 

Programming the same units on the windows atprogram.exe has never revealed any issue so I'm fairly confident that this is a problem with AVRDUDE/Ubuntu/Virtual Machine.

 

I do have a very old Virtual Machine setup with an older version of AVRDUDE which I plan to revisit but please let me know any thoughts.

 

Thanks again.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to AVRFreaks!

 

mike.pcl wrote:
I have very little experience of the AVR products and tools (so please bear with me) but have just started in a new company which (so far) exclusively uses the Atmel microcontrollers.

 

Well your company should invest in the proper tools for the job, as Atmel dev tools are made for Windows machine, that is what you should be using.

Now if you insist on using unix based tools as that is what your most familiar with, that is ok, but you should run that native on the box and use MPLAB X as that is what is supported by MC in that environment. 

Use the latest versions of the tools to get started, then only update if needed once production is in place.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Just to close out this issue I think I've resolved by switching the PC connection to the Olimex to a USB 2 hub.

 

At least this now seems much more reliable so far.