Bad Device signature , help!!

Started by pablodh, December 04, 2013, 12:15:04 AM

pablodh

Hi
I have several moteinos to which only burned them with sketch for testing. To upload the sketch I use a Arduino UNO as a programmer. I think the configuration is correct, particularly the speed at 19200 bps. It happens that when you try the process in a couple of moteinos, I get a wrong value and changing signature.
I copy the message that I get.

......
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75]   [20]
avrdude: Recv: . [14] . [00] . [80] . [00] . [10]
################################################## | 100% 0.02s

avrdude: Device signature = 0x008000
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
         Double check chip, or use -F to override this check.
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
.....

Interestingly the same ID 0x008000 or 0x000000 is repeated in most cases. Someone who can help in the solution.

Regads, Pablo.

juris.g

I think you should use serial baud rate 115200 instead.

pablodh

I forgot to mention I did numerous tests, including changing the speed to 115200. In this case the error is clearly communication.
....
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv:
avrdude: stk500_getsync (): not in sync: resp = 0x00
....
The strange thing is that with the same board settings, port and programmer in the Arduino IDE previously worked with the same moteino.
thanks

Felix

#3
So you're trying to use another Arduino UNO as a serial programmer?
How do you reset the Moteino to get it into the bootloader?
Or are you trying to reflash Moteino completely?

Or are you saying you got a DOA Moteino? That's almost impossible. Actually it sounds like you get this issue with most/all your Moteinos? Even more unlikely they are DOA.
In my early attempts to use another Arduino as programmer I only managed to have success pulling hairs and banging my head on the desk. So I just use FTDI adapter ... it works, every time.

pablodh

Hi Felix
I do not think that is the case, because initially I could load a sketch "Blink". Also happens to me the same with two of the three moteinos I tried so far. I think it's a mistake with my configuration or something like that.
Regards, Pablo.

Spexx

I have also a problem only with some Moteinos with burning the bootloader. In most cases I receive the message "not in sync", but sometimes also the error with the wrong device signature.
I found out, that after removing the RF-module, there is no more error and the bootloader can be burned without problems...

Felix

That's cause the SPI bus is garbled by the RFM69 which floats MISO. You can add a 10K pullup resistor on MISO and reburn the bootloader that way.
There's another topic where similar issues are reported and I think the same is true there: http://lowpowerlab.com/forum/index.php/topic,201.0.html

But let me ask WHY in the world would you do it that way ??
Why reburn it, the bootloader is perfectly fine, why not just program it using the bootloader with a serial programmer?

Spexx

So do you burn the bootloader before soldering the RF-module?
There are two different hex-files at GitHub, one with debugON and one with debugOFF. If I understand it correct, the first one is used for the additional flash chip?
I have used for my moteino without flash chip the hex file with debugOFF. So if I want to add at a later time an additionally chip, I have to reburn the bootloader. Or can I also use the hexfile with debugON in case of using no flash chip? I think the only difference would be a short delay at startup?

Felix

I'm really even more confused, I think you're not asking the right questions. Wondering if you're familiar with the function of the bootloader...  :-\

I burn the bootloader so you don't have to, ever. It's a one time thing. It's like cutting the cord when the Moteino is born. Then Moteino starts crying and breathing. You don't have to do that ever again. Why you would mess with the bootloader is beyond me at this point.

The HEX files I published are only there in case anyone wants to experiment. The code is there also, it explains the difference between debugON and OFF. DebugON just outputs some letters that helped me with developing the custom bootloader. See the code if you'd like to understand what the letters mean.

The FLASH chip is entirely optional, but needed on a target node if you want to wirelessly reprogram it (in addition to the snippet of code that listens for a wireless programming command). There's really not much to all this.

Spexx

Felix, the Moteinos that I have ordered from you all work fine and I use a serial programmer for uploading new sketches.
But because of the long deliver time and the import tax I have also build some own Moteinos and therefore I need to upload the bootloader... I didn't found any information about the differences between DebugON/OFF and I don't know how to view the code of the hex-file, because I'm only familar with the Arduino IDE  ;)

So if I have understood you correct, I don't need the debug option and it doesn't matter, if I want to use a flash chip or not... So I have already used the correct bootloader. But as mentioned, I have soldered the RF-module *before* I have burned the bootloader. It took me several hours to find out, that the RF-module was responsible that I always got some errors.

The next question would be, how to use flash for wireless programming. I'm still missing an instruction for that and I don't know how to use pyton (under Windows) but this is a separate topic and maybe I want to read again your posts about this bevor asking again ::)

By the way, I want to thank you for your great work and for publishing all this information about the Moteino and the libraries  :)

Many greetings from Germany

Felix

Ok now it starts to make sense, if you start with a blank AVR then you have to burn the bootloader. Just load the debugOFF version. The code for the bootloader is also next to the HEX so you can see what I did.

I have several posts on my blog that detail how wireless programming works. There's example Arduino code and libs in my Github repo. Also the moteino page at moteino.com explains to some degree how wireless programming works and why the FLASH is needed.

Thanks for the feedback and feel free to share pics or details on how you made your own Moteinos!