avrdude not using specified USB port

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

Hello.

 

I'm using:

OS: Debian 9.6 64bit

Kernel - 4.18.0-0.bpo.1-amd64

 

uC - AtMega328P

USB to UART bridge with CP2102 chip

 

avrdude Version 6.3

 

I'm using the following Makefile

(I provide the link due to the size of the file)

https://github.com/PsySc0rpi0n/P...

 

The thing is that I have 2 USB devices connected to my laptop and no matter what I set in 

AVRDUDE_PORT

macro in Makefile, line 25, it always seems to be using /dev/ttyUSB0 from what I can see in the "make program" command output:

make program
avrdude -p atmega328p -P /dev/ttyUSB0            -c arduino -V -vvv -E reset  -U flash:w:project.hex:i 

avrdude: Version 6.3, compiled on Oct  2 2016 at 23:15:04
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

avrdude: WARNING: -E option not supported by this programmer type
         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
^CMakefile:279: recipe for target 'program' failed
make: *** [program] Interrupt

 

Please let me know if any additional info is needed and why is this happening?

This topic has a solution.
Last Edited: Sat. Dec 8, 2018 - 08:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After a quick look i saw that line 278 makes the command line for compiling. But its not using the var AVR_DUDE.

Also searching the make file for the var AVR_DUDE its only in the lines 24-26.

 

Maybe add AVR_DUDE to line 278 and see what happens.

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

lightlantern wrote:

After a quick look i saw that line 278 makes the command line for compiling. But its not using the var AVR_DUDE.

Also searching the make file for the var AVR_DUDE its only in the lines 24-26.

 

Maybe add AVR_DUDE to line 278 and see what happens.

 

You mean AVRDUDE_PORT when you say AVR_DUDE, right?

 

Well, line 25 is kinda embedded in line 126

AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)

Then this AVRDUDE_FLAGS macro is used in that line 279. It should be working fine!

Maybe it's time to reboot my laptop.

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

 

PsySc0rpi0n wrote:

 

You mean AVRDUDE_PORT when you say AVR_DUDE, right?

 

 

 

 

Totaly right.

Seems me copy and paste is bad today. A second copy and search for the var did show the line you mentioned.

See line 221 within MAKE:. there its commented. But it should not matter for the programming of the device, due to MAKE: is only for building i say.

 

Can you add

@echo $(AVRDUDE_PORT)

to line 276

 

maybe it gets mangled accross the line.

 

Also check line 143 to get rid of the warning just in case.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Ok, just to let you guys know it's now working. I just rebooted my laptop and it's now recognising the correct port!

No changes made in the Makefile so not sure why it was not "reading" the correct instruction.

 

Fixed.

Last Edited: Sun. Dec 9, 2018 - 11:57 AM