GDB cannot connect to the target board using COMx

Hi all !
I’m a complete noob in AVR programming, so sorry if it’s in some FAQ.

I’m getting an error when I’m connecting ARV Insight to target device.

putpkt: write failed: No error.

GDB cannot connect to the target board using COM2.
Verify that the board is securely connected and, if necessary,
modify the port setting with the debugger preferences.

Port setting is 9600 N 1 N the same in “Dev. manager” and “ARV Insight”

I’m trying to upload BlinkLED example with WinAVR Program menu, but getting the same error of course:

> "make.exe" program
avrdude -p atmega328p -P com2 -c stk500v2    -U flash:w:main.hex 
avrdude: ser_send(): write error: sorry no info avail
make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:01

Code was compiled with WinAVR:

> "make.exe" all

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Compiling C++: main.cpp
avr-gcc -c -mmcu=atmega328p -I. -x c++ -gstabs -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-exceptions -Wall -Wundef -Wa,-adhlns=./main.lst  -MMD -MP -MF .dep/main.o.d main.cpp -o main.o 
main.cpp:3:1: warning: "F_CPU" redefined
<command-line>: warning: this is the location of the previous definition

Linking: main.elf
avr-gcc -mmcu=atmega328p -I. -gstabs -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.o  -std=gnu99 -MMD -MP -MF .dep/main.elf.d main.o --output main.elf -Wl,,--cref     -lm

Creating load file for Flash: main.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock main.elf main.hex

Creating load file for EEPROM: main.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
	--change-section-lma .eeprom=0 --no-change-warnings -O ihex main.elf main.eep || exit 0

Creating Extended Listing: main.lss
avr-objdump -h -S -z main.elf > main.lss

Creating Symbol Table: main.sym
avr-nm -n main.elf > main.sym

Size after:
AVR Memory Usage
Device: atmega328p

Program:     192 bytes (0.6% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)

-------- end --------

> Process Exit Code: 0
> Time Taken: 00:01

Any advice would e appreciated !
Thanks !

UPD: And I don’t see pololu control panel either…
UPD2: TTL port - “This device cannot start. (Code 10)”


If you are using the Pololu USB AVR Programmer, please follow the instructions in the User’s Guide to get it set up. In particular, you need to follow the instructions here to get it working with AVRDUDE. Anyway, the programmer does not support any kind of debugging, so I suspect you are hoping for something that you are not going to get.

Good luck!

Hi, Paul.

My goal is to upload a test program to BabyO. Nothing else.

I’ve compiled it and now I’m going to send it to BabyO using ARV Programmer.

Thanks. I’m trying to setup AVRDUDE…

p.s. but hmmm… debugging is a nice idea =)

UPD: AVRDUDE seem to work fine/ Here’s an output:
avrdude -e -p atmega[or m]328p -P com2 -c avrispv2-U flash:w:main.hex

> "make.exe" program
avrdude -e -p m328p -P com2 -c avrispv2     -U flash:w:main.hex 
avrdude: ser_send(): write error: sorry no info avail
make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:01


It is really unlikely that your programmer is on COM2. As the instructions say,


It is, Paul.

I’ve changed it in advanced settings.
Actually, this setting doesn’t affect anything. I tried default too.
When port number is not correct it says:
avrdude: ser_open(): can’t open device “\.\COM2”: The system cannot find the file specified.

BTW, Oscilloscope works fine.

Are you sure? Can you post a screenshot of the device manager showing that it is using COM2?

What version of Windows are you using? Do you mean the the SLO-Scope application works fine or are you talking about something else?


Yes. That’s right.
SLO scope works fine, but ARVDUDE says write_error.
I think problem is in incorrect driver installation. I’m gonna try it all on my notebook at evening.
Im running Windows XP SP2
Here’s some printscreens.
Port settings:

Note, COM2 is not in use:

Driver information:

Note, that theres no Pololu control panel icon !!!:

TTL port shows “Unable to start” even after programmer firmware upgrade.

It is very clearly stated in the User’s Guide that there are issues with XP SP2; you really should have mentioned that your OS was out of date a long time ago! Is there a reason you are not upgrading to SP3?


Paul, thank you a lot !

You were right about windows version.

I haven’t upgrade it because I just had no need of that.
I’m a very conservative referencing computer stuff.

Additionally, I don’t want to do anything to my platform software on THAT computer, 'cuz we developing very sophisticated software for one of our customers. (SQL/BizTalk/COM+/.NET and many more components)
So I consider it a bit risky to install any servicepacks.

And I DID missed that part about sp2 issue, and I’m sorry for that =(
I think I can say for all of us - your customers, that we REALLY appreciate your quick help and unshakable patience =)

Well, it’s laying here and blinks red LED as it supposed to. Cool =))
Next step is to get it all together working under WinCE.

Maybe the hotfix would work for you, but I don’t know whether you would be willing to even do that on such a critical computer. So does this mean it works for you on your other computer? That’s great!!


Yes, it works fine on my office computer (WinXP w sp3).

I think I would try to setup a hotfix tonight.

Tomorrow is my daughter’s birthday, so I’ll take a break in programming and have to go out to the real world =)