Project

General

Profile

Resolved: A 'trap for young players' or my bad? Solved - it was my bad!! BOARD TYPE = UNO

Added by garethcoleman almost 5 years ago

Hello everybody

I recently received a new jeenode v6 and jeenode usb together with a jeenode micro.

I was tearing my hair out trying to program the jeenodes and couldn’t! But the new jeenode micro worked great.

I could interrogate the new Jeenodes with a usb bub and they were both running rfdemo sketches, I just couldn’t program them

Also when I swapped the mega’s from a programmable jeenode the problem moved with the chip. So I reasoned it must be something to do with the fuses or the bootloader, it wasn’t that I had screwed up the construction subtly somehow.

So I decided that I would try again to get more understanding of the isp programming process.

I discovered that the fuse bits are set differently to my still working jeenode v6. I used avrdude from the command line (installed as part of arduino 1.5.6).

avrdude -v -pt84 -cusbasp -b9600 OR avrdude -v —patmega328p -cusbasp b9600 (I tried several baud rates and they all worked at least some of the time)
JeeNode Micro (working):
avrdude: Device signature = 0x1e930c
avrdude: safemode: lfuse reads as C2
avrdude: safemode: hfuse reads as D7
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK
JeeNode USB (not programmable):
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK
JeeNode v6 (not programmable):
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK
JeeNode v6 (working):
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK
But just changing the fuses of the jeenode v6 to match the working one was not enough
I had to burn a bootloader as well. Now I can program all the devices.

But it did consume a whole afternoon of faffing around, ok I learned something in the process, but also I just went round in circles a fair bit.

When I burned a bootloader via the arduino ide to the Jeenode usb it also set the fuses as per my working ones - as expected. I had the board set to Duemilanovae btw.

So either - what was I doing wrong??

or is this is officially a ‘trap for young players’?


Replies (9)

A 'trap for young players' or my bad? - Added by martynj almost 5 years ago

@gareth,

> I could interrogate the new Jeenodes with a usb bub and they were both running rfdemo sketches, I just couldn’t program them

Were you using the Aurduino IDE to talk to the JeeNodes via the USB BUB?  If so, what symptoms did you get when you compiled a sketch and used the IDE to load in?

The ISP path is usually only needed when the Bootloader is (rarely) corrupted (a fresh copy is burnt in when the rfdemo is loaded up before shipping).  This is different for the JeeNode Micro which requires ISP programming.

RE: A 'trap for young players' or my bad? - Added by JohnO almost 5 years ago

I take it that you did select the correct serial port in the IDE - Tools - Port?

RE: A 'trap for young players' or my bad? - Added by JohnO almost 5 years ago

… and had you closed down the serial terminal program accessing RF12Demo?

RE: A 'trap for young players' or my bad? - Added by garethcoleman almost 5 years ago

Thanks for the suggestions - I have been able to switch between my working and non-working jeenode all afternoon so I now have a good confidence in my tool chain. Specifically I am sure these issues are not around ports or avrdude.conf or boards.txt etc.

If I had just come across a corrupted bootloader on a single board then I would have been able to accept it, I’ve got an isp programmer and I wouldn’t be posting this now. However this same problem happened with two different types of jeenode received in tbe same batch and I wasn’t expecting that. Also even if there was a problem with the bootloader why would my fuses be wrong as well?

As per my previous jeenodes, I was expecting to be able to set the group and node id using the supplied rfdemo sketch, have them pushed to eeprom and move on! And if I hadn’t been working with jeenode micros already then I might not have had the confidence to try burning a fresh bootloader

As it happens I have another v6 kit that I haven’t opened yet. I plan to take the mcu and put it into a known good jeenode, then try to access and change the config, then reprogram it. I’ll probably use a pc that has never had any arduino stuff on it and get a vanilla install of arduino + latest jeelib on it, again to try to reduce the variables. Feel free to suggest investigations I could perform beyond reading fuses and lock bits ta!

Casual browsers - don’t let this hiccup put you off jeenodes! they are incredibly robust for almost everyone almost all the time!

RE: A 'trap for young players' or my bad? - Added by JohnO almost 5 years ago

garethcoleman wrote:
> As per my previous jeenodes, I was expecting to be able to set the group and node id using the supplied rfdemo sketch

When you interact with the non-[programmable devices using RF12Demo what version number of RF12Demo do they announce as you connect to them serially? Also, who did you purchase the units from?

> As it happens I have another v6 kit that I haven’t opened yet. I plan to take the mcu and put it into a known good jeenode, then try to access and change the config, then reprogram it. I’ll probably use a pc that has never had any arduino stuff on it and get a vanilla install of arduino + latest jeelib on it, again to try to reduce the variables. Feel free to suggest investigations I could perform beyond reading fuses and lock bits ta!

I await your results with interest.

> Casual browsers - don’t let this hiccup put you off jeenodes! they are incredibly robust for almost everyone almost all the time!

Agreed!

RE: A 'trap for young players' or my bad? - Added by JohnO almost 5 years ago

I wondered if you received some very old bootloader version that requires Arduino Duemilanove selecting as the board type rather than that current OptiBoot where one selects Arduino Uno.

RE: A 'trap for young players' or my bad? - Added by garethcoleman almost 5 years ago

Ok finally I was able to sit down in peace and look at the unopened JeeNode v6 that I got from the digitalsmarties shop just a few days ago.

I used a vanilla ubuntu desktop pc, and installed vanilla arduino from the repository - I got version 1:1.0.5+dfsg2-1.

Plugging in my trusty USB bub II I opened up the arduino serial monitor and saw RF12demo.8 running sweetly, I was able to set the group and node ID and it read the data from other sensors I have running. Sending a test data packet also worked as expected. So far, so good.

Now to look at the fuses:
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: reading lock memory:
0xf

hmmm this jeenode looks the same as the other one recently received. And when trying to upload a new sketch via the arduino ‘upload’ button, I get:

avrdude: stk500_getsync(): not in sync: resp=0x4f

Ok so lets try the same with the board set to uno. And voila! I can upload a sketch!

Duh! is that all I was doing wrong? I went back to another jeenode v6 and it needed the board set to duemilanove - perhaps this is because I burned a bootloader whilst the board type was set to that?

So now I have a mixture of jeenode v6’s with different fuse bits and requiring different board settings. So I set the board type to uno and then burned bootloaders to those that needed the board set to ‘Due’ - and now the fuses are:
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK

And the boards now accept uploads with board type set to ‘uno’.

Can anyone explain the consequences of leaving the fuse bits with some set to lower fuse of 0xFF and some to 0xDE?

I went back to the jeenode smd (sorry I was saying jeenode USB before, it was actually a smd jeenode).

I wasn’t able to program it using the usb bub with a board set to anything until I burned an uno bootloader, and again that enabled the use of the board set to uno with the usb bub.

So at the end of the day, I think I just had the idea that the board needed to be set to ‘Due’ - wheras if I’d stuck with ‘uno’ I would have been fine. Perhaps my original jeenode was from an older batch or perhaps I’ve burned the wrong bootloader onto it. Opps! sorry and thanks for the help in tracking it down.

RE: A 'trap for young players' or my bad? Solved - it was my bad!! BOARD TYPE = UNO - Added by martynj almost 5 years ago

@gcoleman,

From the Shop catalog page:

> As of mid-Jan 2012, JeeNodes ship with OptiBoot 4.4, which is compatible with Uno boards (the previous bootstrap was for Duemilanove’s).

RE: Resolved: A 'trap for young players' or my bad? Solved - it was my bad!! BOARD TYPE = UNO - Added by garethcoleman almost 5 years ago

Yes! sometimes the obvious blinds you, sorry.

BTW after much reading of data sheets and searching I found this post very useful: http://forum.jeelabs.net/node/848.html

And of course the full data sheet is a measly 500+ pages!

In summary, I think a jeenode (v6) should have fuses like these:
lower_fuse = 0xde - sets up the external reset line, the watchdog timers and the boot loader size to minimal.
higher_fuse = 0xde - sets up the clock source (16MHz resonator) and startup time.
extended_fuse = 0x05 - brown-out detection - only lowest two bits actually used - sets the jeenode up for 3.3v operation.

But looking at the datasheet (table 9.4, p30) then this higher fuse setting seems to set an additional delay from reset to 65ms as opposed to 4.1ms?

Is this the setting that is referred to in this post? http://jeelabs.org/2010/09/03/jeenode-goes-solar/

I think after all this I will re-visit the post here: http://forum.jeelabs.net/node/848.html and try to get an entry for a regular jeenode on my ardiuno menu. At least then I would never get the board type wrong again

    (1-9/9)