Cannot Upload to Arduino Nano on PC (Works on Mac)

Hello,

I am working on a project using the MAXREFDES117# (heart rate and spO2 sensor), and the algorithm provided doesnt work on the Arduino IDE later than version 1.6.6, for some reason. I am running 1.6.5 right now on my PC and I can upload the whole project to the Arduino Uno no problem and everything works, but I need it on the Nano. This is a genuine Nano with the ATMEGA328. It was purchased very recently. It goes through the 10 attempts of:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x9d

avrdude: stk500_recv(): programmer is not responding

The first thing I checked was the cable, but plugging it into my Mac running Arduino 1.8.10 everything works and I'm able to upload Blink no problem. On the PC it gets through compiling fine so there aren't code errors at least, it just can't upload. Let me know if there is anything else I can try, thanks.

~Hunter

Do this:

  • Tools > Board > Boards Manager
  • Wait for the downloads to finish.
  • From the list of boards platforms, click on "Arduino AVR Boards".
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click the "Close" button.

Now try uploading again.

In 2018, Arduino changed the bootloader used on the official Nanos. This required a change in the board definition. Since your Arduino IDE 1.6.5/1.6.6 was released before 2018, the Arduino AVR Boards platform that comes with the IDE doesn't have the Nano board definition that works with the new bootloader. However, Boards Manager allows you to install the modern Arduino AVR Boards that does have the Nano board definition for the new bootloader. So you are able to use your modern Nano with those ancient Arduino IDE version if you really are set on it. However, I do recommend that you update your IDE if possible, since a lot of improvements have been made since that time.

Okay that updated boot loader is apparently the cause of the program not functioning as written on later versions, so updating the boards and boot loaders means that now I cannot actually compile anymore. Is there a way I can upload an old boot loader to the board? This is unfortunately out of my area of understanding. Thank you in advance for your help!

And I did try using the option labeled "old boot loader" for the 328, it still had the compiling error.

Please do this:

  • When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link that will allow you to make the attachment.

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Nano, ATmega328P"

Build options changed, rebuilding all

C:\Users\htkgo\AppData\Local\Temp\cc5Oirtm.ltrans0.ltrans.o: In function `i2c_start(unsigned char) [clone .constprop.27]':
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:309: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:309: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:309: undefined reference to `ass_i2c_write'
C:\Users\htkgo\AppData\Local\Temp\cc5Oirtm.ltrans0.ltrans.o: In function `i2c_rep_start(unsigned char) [clone .constprop.26]':
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:334: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:334: undefined reference to `ass_i2c_write'
C:\Users\htkgo\AppData\Local\Temp\cc5Oirtm.ltrans0.ltrans.o: In function `i2c_write':
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:458: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:458: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\cc5Oirtm.ltrans0.ltrans.o: In function `i2c_read':
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:528: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:528: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\cc5Oirtm.ltrans0.ltrans.o: In function `ass_i2c_stop':
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:382: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:382: undefined reference to `ass_i2c_delay_half'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:382: undefined reference to `ass_i2c_wait_scl_high'
C:\Users\htkgo\AppData\Local\Temp\build4462781461977672096.tmp/SoftI2CMaster.h:382: undefined reference to `ass_i2c_delay_half'
collect2.exe: error: ld returned 1 exit status
Error compiling.

 This report would have more information with
 "Show verbose output during compilation"
 enabled in File > Preferences.

The exact same code compiles perfectly on 1.6.6 and earlier, but this is what happens with the update to the AVR Boards. Also turning on verbose output was too long to send.

The non-verbose output is just fine for now. The verbose part of the compilation output is only useful in very specific cases. Since it almost always makes the output exceed the forum's 9000 character limit, I usually recommend against having it turned on for the output you post on the forum unless someone specifically asks for it.

In the case of problems with uploading, the verbose output is often needed (and just generally useful), so I recommend always having that setting enabled.


I looked for the SoftI2CMaster master, and it looks like there are a few different ones available. Do you remember where you got that library from? If so, please post a link to it, or if you installed it via Library Manager then say so.

Thank you, this is the chip I purchased:

https://www.digikey.com/product-detail/en/maxim-integrated/MAXREFDES117/MAXREFDES117-ND/6165562?utm_adgroup=General&utm_source=google&utm_medium=cpc&utm_campaign=Dynamic%20Search_RLSA&utm_term=&utm_content=General&gclid=CjwKCAjwnK36BRBVEiwAsMT8WGH85wyc8gIxl6A9I0W9uS656C6dgHcH28TzQ6KB4Zxsl2dDDnb2xxoCiS0QAvD_BwE

On there if you select Design Files then it shows up with the algorithm used to make everything on the chip run.

As a possible solution, is there a way I can use an Uno and install the pre-2018 boot loader onto the nano? I think that would solve the problems right? Thanks.

~Hunter

hunterk55:
Thank you, this is the chip I purchased:

I'm asking about an Arduino library called SoftI2CMaster. These are some files on your computer that contain Arduino code. It seems like maybe something about that code is not compatible with some aspect of the new version of Arduino AVR Boards (perhaps the compiler).

In order to investigate that situation, I really need to be able to reproduce it on my own computer, which means I need to have the specific version of this SoftI2CMaster library that you have installed on my computer.

hunterk55:
As a possible solution, is there a way I can use an Uno and install the pre-2018 boot loader onto the nano? I think that would solve the problems right?

The bootloader is not at all the cause of your problem. So changing the bootloader won't directly fix the problem. However, changing the bootloader would allow you to go back to that outdated version of Arduino AVR Boards, so it could provide a workaround.

Yes, the older releases of IDE are still available,

@hunterk55 is already using an old IDE version: 1.6.5

Attached the code for the Arduino that I extracted from the page that @hunterk55 referred to. @hunterk55 needs to confirm if this is the correct one.

RD117_ARDUINO.zip (32.2 KB)

Yes that is the correct file. Inside there is the library for the SoftI2CMaster, it wasn't something I had to download, it was opened as an extra page of code along with like 4 other libraries all of which get referenced, but none are installed in the classic Library location like I've always used in the past, one of the reasons this is difficult to troubleshoot.

And yeah I know the boot loader on the nano isn't the cause of the issues, but if theres a way I could install the pre-2018 boot loader and use IDE 1.6.6, then that could possibly work right? And in the future I could reinstall the newer one if that ever became necessary right? Do you know where I could find the code to program the booloader using an Uno? Thanks so much everyone for your help!

The below will probably work to get the old boot loader in the new Nano

Note in advance that you need to wire connections between Uno and Nano (before step 4)

Programming steps
1)
Load the ArduinoISP sketch in an Uno
2)
Select board "Nano"
Select processor "328P (old boot loader)."
3)
Select programmer "arduino as isp"
4)
Burn boot loader

Thanks so much, that worked perfectly and I can upload to the nano now, really appreciate the help!