Pro Micro programming difficulties without Arduino IDE

Hello,

I have Pro Micro
(picture http://www.jayconsystems.com/media/catalog/product/cache/1/image/800x600/040ec09b1e35df139433887a97daa66f/j/a/jaycon_systems_promicro_1.jpg)
(other picture http://www.uctronics.com/static/images/20130828/arduino-pro-micro-atmega32u4-16mhz-00b89c8d-800x800.jpg)

When I use arduino IDE I can program the device without any problems. However, when I try to use avrdude from terminal, I get 'programmer is not responding' error.

Here is verbose output with Arduino IDE:

[size=10pt]/home/XXX/arduino-1.5.6-r2/hardware/tools/avrdude -C/home/XXX/arduino-1.5.6-r2/hardware/tools/avrdude.conf -v -v -v -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/build2131402120248722624.tmp/sketch_feb26a.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  9 2011 at 16:00:41
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/home/XXX/arduino-1.5.6-r2/hardware/tools/avrdude.conf"
         User configuration file is "/home/XXX/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       1024    8      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  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

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: Send: . [1b] 
avrdude: Send: S [53] 
avrdude: Recv: C [43] 

avrdude: Recv: A [41] T [54] E [45] R [52] I [49] N [4e] 
avrdude: Send: V [56] 
avrdude: Recv: 1 [31] 0 [30] 
avrdude: Send: v [76] 
avrdude: Recv: ? [3f] 
avrdude: Send: p [70] 
avrdude: Recv: S [53] 
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.[/size]

And so on..

But when I try to use the command from the terminal, I get error. The verbose output is exactly the same until it doesn't receive any response:

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: Send: . [1b] 
avrdude: Send: S [53] 
avrdude: ser_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding

What can possibly cause this? Should I erase the bootloader and put Atmel's default bootloader to it and try again?

vesa:
When I use Arduino IDE I can program the device without any problems. However, when I try to use avrdude from terminal, I get 'programmer is not responding' error.

Probably should go back and put all that output into a "code" block to make it easier to work through.

I presume you essentially copied the command line from that verbose output, to the terminal? Did you close the Arduino IDE before you actually executed the "terminal" command? Not sure, but just a thought.

Only other option may be to su (sudo) the command.

I fixed the formatting as you requested.

I tried running as super user too. I also tried using the same avrdude config file as Arduino IDE uses. Moreover, I used the same avrdude binary that can be found from Arduino's folder.

I found what the problem was. The board must be resetted. After pulling reset down for a moment, the bootloader waits for 8 seconds for program to be uploaded. If upload doesn't happen in 8 seconds, then the bootloader moves to execute the actual current program on microcontroller.

So, the solution is to reset the microcontroller by jumpwire manually, or by connecting to the board by serial monitor and then quickly closing it. And during 8 seconds one is able to program the board.

http://forums.adafruit.com/viewtopic.php?f=22&t=35335

vesa:
I found what the problem was. The board must be reset.

Ah yes, it most certainly must be reset, but that would - as best I know - apply the same whether you use the IDE or the command line.