Unable to flash moteino

Started by tleavitt, May 25, 2020, 11:19:10 PM

tleavitt

So I ran into a rather curious issue today trying to update the code on a couple moteinos I have. Of the 6 I needed to update, I had two I was unable to flash code to, but they run the existing code in memory just fine. When attempting to flash, I get an out of sync error with the resp usually being some random hex code. But all 10 attempts have the same hex code. Does anyone have any ideas on what has happened to my motes and if there is any way to flash new code to them, or are they basically bricked with the current code?

Also, I have two more motes that Im not sure if theyre dead or not. Attempting to flash them gets the out of sync error as well with a non zero response, but I have no idea what code is on them at this point. Is there an easy way to tell if a chip is just outright dead?

Felix

Moteinos don't normally just decide to refuse accepting an upload.
How exactly do you "flash code" to them?

tleavitt

Quote from: Felix on May 26, 2020, 10:38:09 AM
Moteinos don't normally just decide to refuse accepting an upload.
How exactly do you "flash code" to them?

I use your FTDI header and Arduino IDE 1.8.12.
The moteinos reset when the upload attempts to start but the chip and FTDI adapter never get in sync. Is it possible something happened to the boot loader?

Felix

Quote from: tleavitt on May 26, 2020, 11:22:51 PM
I use your FTDI header and Arduino IDE 1.8.12.

And what do you use with the FTDI header? Please explain the entire procedure, is what I was asking.
Does that same procedure work with another Moteino?

Quote from: tleavitt on May 26, 2020, 11:22:51 PM
Is it possible something happened to the boot loader?

If you get a ISP programmer, read the flash memory and then you will know for sure, if and what happened.
Otherwise its a guessing game.

tleavitt

Quote from: Felix on May 27, 2020, 09:16:51 AM
And what do you use with the FTDI header? Please explain the entire procedure, is what I was asking.
Does that same procedure work with another Moteino?

If you get a ISP programmer, read the flash memory and then you will know for sure, if and what happened.
Otherwise its a guessing game.

So my normal procedure is to plug the FTDI chip into my laptop and then I select the port in the arduino IDE. Then I plug the FTDI adapter onto the header on the moteino, then upload the code and check it with the serial monitor. This process works on every moteino I have but 2.
I will have to try the ISP checking. I don't have a dedicated ISP chip, but I believe I can use the arduino as ISP with the moteinos, correct?

Felix

What FTDI Adapter are you using? The LPL one or some 3rd party one?
You can use Arduino as ISP but I would not put myself through that torture. A proper ISP programmer is a good companion when you work with AVRs a lot.

tleavitt

Quote from: Felix on May 27, 2020, 01:50:56 PM
What FTDI Adapter are you using? The LPL one or some 3rd party one?
You can use Arduino as ISP but I would not put myself through that torture. A proper ISP programmer is a good companion when you work with AVRs a lot.

Im using the LPL FTDI adapter.
Ill have to look into ordering a proper ISP. Im getting more and more moteinos and arduinos as my projects expand so I probably should invest in one for next time something funky happens with them.

Felix

If you power those 2 in question, and reset them (short RST to GND for a second), does the LED blink at all?

tleavitt

Quote from: Felix on May 27, 2020, 09:04:40 PM
If you power those 2 in question, and reset them (short RST to GND for a second), does the LED blink at all?

Yeah, the LED flashes.

Felix

So, LEDs dont flash on their own, fortunately  ;)
That means there's a program on the AVR. Ie the bootloader (or something else).
If it's the bootloader that means there's some problem resetting that Moteino from the FTDI adapter just before starting the serial upload.

tleavitt

Quote from: Felix on May 28, 2020, 12:46:23 PM
So, LEDs dont flash on their own, fortunately  ;)
That means there's a program on the AVR. Ie the bootloader (or something else).
If it's the bootloader that means there's some problem resetting that Moteino from the FTDI adapter just before starting the serial upload.

I'll look into ordering an ISP then and see what's up with the boot loader. Maybe I corrupted something while experimenting with OTA programming