1

Out of curiosity, I am trying to upload a simple hex file to Arduino UNO using avrdude from windows command prompt.

As per this forum, I tried to implement it. But got stuck at

avrdude: ser_open(): can't open device "COM41": The system cannot find the file specified.

This command was directly imported from Arduino IDE verbose, and also it works fine when uploaded with Arduino IDE. I checked both the device and syntax are correct unless I would not be able to generate the hex file by Arduino compiler.

P.S. I have installed Winavr separately although it was pre-installed by Arduino itself.

Here is a snapshot of the error command prompt

What could be the possible reason for it to fail? Please notify, if anything is missing.

  • I seems like you are using a different avrdude, as normally arduino uses the avrdude binary that is inside the arduino application folder. Also the avrdude conf-file is missing. So it looks to me like you have modified the command "directly imported" from the IDE. – Gerben Aug 6 '16 at 9:18
  • @Gerben I downloaded the software Winavr and installed it separately. This is not the avrdude that was present inside arduino application folder. – goddland_16 Aug 7 '16 at 17:30
1
can't open device "COM41": The system cannot find the file specified.

This means there is no device at COM41. This may be due to 2 reasons:

  1. You may not have connected your arduino. If this is the case then you please connect the arduino and retry

  2. Your arduino might be on a different COM port. If this is the case, then, go to device manager and check your arduino's COM port and replace COM41 with that and retry.

  • No, that is not the case here. As I said I have connected the Arduino and in the device manager it showed COM41. And I can easily program it from arduino IDE, but when I try to upload using Avrdude it shows this particular error. – goddland_16 Aug 7 '16 at 17:27
1

After a lot of experiment, I finally made it. I got to know from some forum that when COM PORT is greater than 10, you have to put a '.' after COM PORT setting e.g. -P.COM41.

But, unfortunately that did not work. Then I changed the COM PORT to under 10 in device manager -> Properties -> COM Port Setting -> Advanced Setting; e.g. COM6. Then it worked. At the time of flash just I have to press the RST button for once. And now bingo!!

Still, I will try to find out why it didn't work with higher COM Port.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.