Problem uploading new code into uArm Metal

Hello,

I developed a program in arduino IDE which continuously send data through serial connection, in order to communicate with another arduino board. Here is the code i used :

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.print(‘H’);
delay(100);
Serial.print(‘L’);
delay(100);
}
But now I have some issues to uploading a new program, when I try uploading new code I have this error :
avrdude: stk500_getsync(): not in sync: resp=0x00

I think it’s because I cannot upload new code while uArm flood communication and busy.

Any solutions to erase the old program or reset uArm to factory settings ?
Thanks

Hey! I’ve had sync issues while working with arduino before, not that exact error though.

I usually fix them by, and this sounds quite hacky, just spamming the upload button until it works. It also helps if you press the “reset” button on the robot before uploading.

Before you waste too much time doing that, check and see if this troubleshooting guide helps!

Yes, you cannot use the serial connection for anything else while you are uploading code. That said, if the other Arduino is not responding, the upload will first shut off your loop so it should work.

So if apockil’s advice doesn’t work, disconnect the other Arduino and see if that makes a difference. Also, try disconnecting the arm from your development computer, close any open serial monitors, reconnect the uARM to your dev computer and try the upload.

Dave

Thanks for your answers, unfortunately I already saw this link and followed the guide and commentary, any of them worked.
I also tried to press the reset button on the robot before/at the beginning of the uploading, it just restart the old program and give me the same error above.

For now I just connect the uArm to the computer without other devices and try to upload “MoveTo” example or blank program. If I open the serial monitor I can see characters transmitted by the uArm, blue leds seem to indicate a starting communication between computer and uAm but never go to the end.

This is why I think the better solution is to clean the memory of the robot, but I don’t know how to do this, and just few pins are available with the reset button.

A standard Arduino will wait a few seconds before starting the loaded sketch after it powers up so that a new sketch can be loaded. Since you old sketch sends serial data at startup, waiting too long will make it so a new sketch cannot be uploaded.

So try this:

  1. As before, start with nothing connected to uARM.
  2. Close any old serial monitor windows that are open.
  3. Connect uARM via USB to your dev computer and hit Upload immediately (do not wait to open a serial monitor).
  4. While the sketch is uploading, make sure the AC power is turned on to the uARM as well. (Normally, you should do that first, but it would have booted the board.)

If that does not work, you can always burn your sketch using an external bootloader.

I will try this process, and also testing to burn my sketch with external bootloader via parallel programmer https://www.arduino.cc/en/Hacking/ParallelProgrammer

An external bootloader needs to connect 6 pin ( GND, Reset, VCC, MISO,MOSI & SCK) to the arduino. Are they the 6 pins available on the red square, at the right of D3 on the uArm pinout ?

No, unfortunately, only pins D8, D9, A6 and A7 are available. You can see their locations on the pinout diagram.

So I stand corrected, I do not think an external bootloader will work. Have you been able to try the other method?

It’s surprising because I successfully burnt my sketch with external bootloader, using another arduino as programmer.
I verified with multimeter that the 6 pins are connected to the atmega 328p uC and followed this tutorial to burn the bootlader:
https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader

Now I can upload new codes into the uArm using this method and select “upload using programmer” and “programmer : arduino as ISP” in arduino IDE options.

I also tried the method you described before (connect uArm via USB and hit upload immediately), it didn’t work.

Now an other problem still remain, I cannot upload code via USB (same error as the first post) and data received by the uArm are not read, whereas the transmitted data by the uArm work well.

I think the method you have developed for using an external bootloader is fantastic. I would not have thought to simply use the pins directly.

I hope I can encourage you to post your method as a new top-level post. I, for one, would make use of it!

On the USB topic, the only other thing I can think of is to ground the reset pin and release the connection as you begin the upload. Of course, this is basically the same thing as I suggested before, but may help. It may be worth noting that you should take compile time into account. Using blink.ino as your test upload removes any timing issues.

Since you clearly know your way around, you’ve eliminated the simple pitfalls already. I am afraid that is all I have. :slight_smile:

Thank you for your reply, but I finally I didn’t found the solution, so I exchanged it.
If it could help I will post on another topic the method used to erase memory, it worked for me but I cannot guarantee that it’s secure for the uArm.