Programming the AVR does not work after using a serial programme


I'm using an Arduino Duemilanove with an ATmega328p chip on Ubuntu 11.10. My problem is the following:

I've uploaded the code from this tutorial to my device, and it seems to be working fine (I've configured the famous `minicom' application to 9600 baud, 8-bit, no parity, 1 start, 1 stop bit - as it was specified in the tutorial, and I got the 'Hello World!' message every 5 seconds, as expected.). However, I can't upload hex files to my Arduino anymore. I'm using avrdude with the following parameters: (the config file is the usual Arduino avrdude config file):

avrdude -C avrdude.conf -p atmega328p -c arduino -b 57600 -P /dev/ttyUSB0 -U flash:w:serial.hex:i

I even tried it with baud rate=9600. I'm getting various error messages from avrdude, including:

avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x00
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0

However, the board resets correctly, isn't stuck in a loop...

I'm sure it's the serial settings which messed up the board, but how can I fix it? (since I can't set the UART control bits back without being able to upload new code to the MCU...)

Thanks in advance!


I didn't notice I was running "minicom" in the background. Killed Minicom, unplugged/replugged the Arduino, and it works now perfectly!