Project

General

Profile

On going: Issues with Programming a Jeenode Micro

Added by henry over 5 years ago

Hi,
I have a big problem with program a Jeenode Micro v3. I prepared all like discribed here:[[[http://jeelabs.org/2013/03/21/programming-the-jn%C2%B5-at-last/]]]. I use the Arduino IDE 1.5.4 on Windows and a Jeelabs Flashboard.
But the step ‘burning bootloader’ doesn’t work. The Arduino IDE shows this error: Error while burning bootloader: missig ‘erase.params.verbose’ configuration parameter.
Can anybody help me?
Many thanks and kind regards
Henry from Germany


Replies (72)

RE: problem with program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

@Henry

I looked at your files and I think you are still missing some data.

First — quit (close) the Arduino IDE software.

I have copied my own boards.txt file for you. I uploaded it here as boards_for_henry.txt. You might want to rename your boards.txt file to boards.txt.backup and rename the boards_for_henry.txt file to boards.txt.

In the same way I have copied my complete platform.txt file for you. It is uploaded here as platform_for_henry.txt. Rename your platform.txt file to platform.txt.backup and rename the platform_for_henry.txt file to platform.txt.

Now connect your JeeNode Micro to your USB cable, start the Arduino IDE again, and try to burn the bootloader. It should work now.

Kind regards

Bob

boards_for_henry.txt (1.3 KB) boards_for_henry.txt boards.txt file from Bob Cochran
platform_for_henry.txt (3.83 KB) platform_for_henry.txt platform.txt file from Bob Cochran

RE: problem with program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

I couldn’t resist after spending so much time working with the Micro. I adapted a sketch to make pin 8 go high and low, and I successfully uploaded it to the JeeNode Micro. I notice that when using the flash board and the Arduino as ISP feature, you get quite a lot of output in the serial window even for one tiny sketch.

However it does seem to work. I put an LED and resistor in a breadboard, then connected Pin 8 and Ground from the JeeNode Micro to the LED. Then I put a CR2032 coin cell battery in the Micro and the sketch started working very nicely.

Thanks Martynj, JohnO, and Henry for all your help!

Bob

JeeNode Micro at last blinking an LED (on Arduino Pin 8)

jeenode_micro_blinking_led_pin_8_small.jpg (153 KB) jeenode_micro_blinking_led_pin_8_small.jpg JeeNode Micro at last blinking an LED (on Arduino Pin 8)
1575

RE: problem with program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

@Bob, I hope the " the honey do list " is complete too.

henry, are you closing all instances of Arduino before/after making changes and then restarting?

RE: problem with program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

henry in your boards file I see jnmicro.erase.speed=19200 I think should now be jnmicro.erase.speed=9600.

RE: problem with program a Jeenode Micro (please help) - Added by henry over 5 years ago

Hi Guys,

I’m so happy! All works fine. With Bobs configuration files and all other helpful posts I’ve burned the bootloader and loaded sketches for blinking a LED and sending pin values from the JNµ!

Thanks a lot Bob, JohnO, and Martynj for all your great help!

Henry

RE: problem with program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

@Henry, I am very happy that I helped you and you are using your JeeNode Micro successfully. JohnO and Martynj are very helpful to me. I am happy that we all teamed up and figured out how to get the bootloader flashed.

Henry, your experience here suggests that my revised and updated boards.txt and platform.txt files can help others as well, so I will go ahead and fork the the jcw/ide-hardware Github repository and do a pull request on it. This will take me about 2 weeks to do because of my committments. Also, I want to write up good documentation covering what we have done. That takes a little time.

We are probably all learning that we need at least one Arduino device which is set up as a dedicated programmer for the JeeNode Micro. I’ve ordered a Really Bare Bones Board (3.3v) kit from Modern Device just now, I want to see if I can connect it to the JeeNode flash board or directly connect it to the JeeNode Micro and use that as the programming device. This way, I can put the radio on my JeeNode V6 to use.

@JohnO I know what you mean about my specific JeeNode V6 having an older bootloader. Maybe I ought to re-flash it with a newer bootloader using the Really Bare Bones Board that I just ordered.

Kind regards

Bob

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

I have gone ahead and forked jcw/ide-hardware project on GitHub. My fork is here:

https://github.com/BobCochran/ide-hardware

You might want to review it when time allows. I am thinking of adding a “hardware_photos” folder containing pictures of the JeeNode Micro set up for programming.

Kind regards

Bob Cochran

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

I’m running into some of the same issues and I think I need to take a step back.

JohnO’s first response was “With the Micro the process of burning the bootloader only sets the fuses as typically a bootloader isn’t used with the Tiny processors.” - which I think is correct, a bootloader isn’t necessary for the Micro since it can only be programmed with ISP (unless you are using an OTA update process… but I understand that’s experimental at best with the micro). So… do we even need a bootloader on the JNmicro to run sketches?

Next, what method are you using to upload the sketch (not the bootloader) to the JNMicro? In the Arduino IDE there’s an option in the File Menu “Upload Using Programmer (Ctrl+Shift+U)” - is this what you are using?

After enabling the debug functions, namely to show me the output from AVRDude, I realized it’s trying to program at 19200 baud. I copy/pasted the command from the IDE into a cmd prompt and changed the baud to 9600 and it appears to have programmed just fine. I’ve checked the boards and platform.txt files and they are set to use 9600 baud. Perhaps the IDE is not using the jeelabs/avr/boards.txt and platform.txt files?

As a test, I’m trying to use test1.ino from jeelabs to test the JN Micro. Can the same code be used for the Micro, or are there changes that need to be made?

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

Which version IDE are you using, is JeeNode Micro selected from Tools > Board menu?

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

After reading wolfpackmars2 comments I’m confused. Can an Arduino sketch be run on the ATTINY84 chip without first burning a bootloader to it? I had always thought a bootloader is required in order to execute an Arduino-style sketch uploaded via the Arduino IDE. I went through this entire project believing that one needs to have a bootloader for this purpose. Am I wrong?

However, if JohnO’s original comment was meant to convey that you don’t need a bootloader if you want run code in the chip’s native assembly language, I can see that also. For assembler code you still need a programmer device to flash the code into the chip and start it running, of course.

Thanks

Bob

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

My understanding is that ATTiny & ATMEGA can execute machine code from birth. Again from birth they can understand the ISP connector and read in values to store in their flash. They don’t care if the values they read were created using an assembler or a C compiler they pass control to a particular address and attempt to execute what is located there.

The default fuses are very conservative to ensure the ISP connector is functional and the clock rate achievable with available voltage. From memory the divide by 8 fuse and the internal clock fuse are certainly set. On a ATTiny84 with is 8MHz internal clock divided by 8 gives a 1MHz execution speed. The RFM12B requires a minimum clock speed of 4MHz to operate correctly.

Sometime after birth some ATMEGA chips are designated for the Arduino world and have some machine code loaded into their flash which is able to perform a bootloader function - that is read in machine code values from the UART interface and place them in specific areas of the flash memory. This is to keep down the price and increase the convenience of playing in the Arduino world. If you have a large piece of machine code that you wish to run on the ATMEGA328 you can set appropriate fuses and write the whole flash including bootloader with your bespoke machine code.

The ATMEGA328 has a number of fuses designed to protect the bootloader from accidental corruption but the ATTiny doesn’t have these. A nice little bootloader was introduced on the forum recently, http://jtxp.org/tech/tinysafeboot\_en.htm this gives the ATTiny the ability to read an emulated UART and transfer values into its flash memory. It works a treat but uses up a little of the limited flash on the ATTiny.

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

Bob,

As I understand, the bootloader is only needed if you intend to program your chip by any means other than ISP. ISP writes directly to the chip, whereas the bootloader takes serial data presented to it and writes it to the chip for you, without the need for a separate ISP programmer. As I understand it (and I sincerely apologize if I have this wrong), when you upload your sketch [using ISP], you will overwrite any code already on the chip, including bootloader. As a test, you can determine if the bootloader is working on your chip or not - program a sketch that immediately blinks an LED a certain way. If this LED starts blinking immediately upon boot, then likely you have no bootloader (as a bootloader would cause a 10 second delay at boot while it waits to see if you have any firmware to load). Again there are many factors that can affect this. For the Tiny, the only real effective bootloader I can think of is an OTA (over the air) bootloader, but I don’t think anyone has created one that supports the AtTiny84 beyond “experimental” status yet.

Now as to uploading from the arduino IDE, I have been able to successfully create a sketch and upload it outside of the IDE. Here’s what I get in the IDE: [see attached file]

if I copy the avrdude line provided by the IDE and change -b19200 to b9600, then the sketch flashes just fine (in command prompt).
This is my current boards.txt:
<pre>
jnmicro.name=JeeNode Micro
jnmicro.upload.tool=avrdude
#jnmicro.upload.protocol=arduino
jnmicro.upload.maximum_size=8192
jnmicro.upload.maximum_data_size=512
jnmicro.upload.speed=9600
jnmicro.upload.using=arduinoisp
jnmicro.bootloader.tool=avrdude
jnmicro.bootloader.low_fuses=0xC2
jnmicro.bootloader.high_fuses=0xD7
jnmicro.bootloader.extended_fuses=0xFF
jnmicro.bootloader.unlock_bits=0xFF
jnmicro.bootloader.lock_bits=0xFF
#FIXME this boot loader is bogus, IDE 1.5.x does not look in the right place?
jnmicro.bootloader.file=atmega8/ATmegaBOOT.hex
jnmicro.build.mcu=attiny84
jnmicro.build.f_cpu=8000000L
jnmicro.build.board=AVR_JNMICRO
jnmicro.build.core=tiny
jnmicro.build.variant=standard
</pre>
I’ve tried several different things, but it will not set the baud to 9600. Looking at the original boards.txt provided by the arduino IDE, I notice that not one of the boards provided programs slower than 19200
I would almost believe the IDE does not support 9600 baud, but that’s crazy, because I know people are doing this every day…

Arduino IDE version 1.5.4

Jeenode Micro is selected from the board menu under tools. I’m using a Jeenode USB as ISP, using the ISP_flash example sketch provided by jeelib. I downloaded the most recent version of github.com/jcw/ide-hardware and following the setup instructions provided there to set up the environment. It’s a clean install of Arduino IDE.

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

Found this: https://github.com/TCWORLD/ATTinyCore/blob/master/tiny/bootloaders/optiboot/Readme%20for%20Tuned%20optiboot.txt

Someone has made an optiboot for Tiny84 chips. It uses PA1, PA2 and PB2 lines. Before trying to use it on a Jeenode, understand that line PB2 is used by the radio for IRQ on a Jeenode Micro. Essentially, the bootloader allows you to connect the TX and RX lines of a com port to the Tiny84 and program it directly using the upload function in the IDE.

They also talk about using 9600 baud to communicate with an 8mhz Tiny84. https://github.com/TCWORLD/ATTinyCore/issues/4

I don’t see much benefit to using a bootloader, IF the ISP method can be made to work.

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

The 9600 communication speed is the serial speed between the PC & the programmer - not the Tiny84! The programmer generates a clock to drive the ISP connection. You could recompile the programmer sketch to run at 19200 but there is something else amiss somewhere.

I note that your screen dump says you are using an stk500v1 programmer.

When you select Tools in the IDE are you able to make a selection of programmer?

RE: Resolved: problem with program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

OK I found it, FINALLY.

It seems that arduino/hardware/arduino/avr/programmers.txt is where the value came from.

Change:

arduinoisp.program.speed=19200

to

arduinoisp.program.speed=9600

Yep, verified… That solved it. I can now upload sketches through JeenodeAsISP to a Jeenode Micro using the arduino IDE.

RE: Problem to program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

John, I believe the ArduinoISP (Jeenode et. al.) emulates an stk500v1 programmer.

At any rate, modifying programmers.txt resolved the issue. I have been able to modify the Jeelib Blip2.ino and upload it. My Jeelink is happily receiving the correct data.

It should be noted that there are two baud rates specified in the programmers.txt file for arduinoisp:

arduinoisp.speed << This is the communications speed between the PC and the Arduino ISP programmer
arduinoisp.program.speed << This is the speed between the programmer (ArduinoISP) and the target (Jeenode Micro in my case).

I left arduinoisp.speed at 19200 and modified the .program.speed to 9600 as stated above.

There is probably a better way to do this. I don’t think people should modify the file I modified (they should create a modified file). Hell, IMO this shouldn’t even be necessary. This may be a bug in the arduino IDE? I would think that the boards.txt should override the programmers.txt, but that’s just me.

As a final note, the stk500v1 also comes from the infamous programmers.txt:

arduinoisp.protocol=stk500v1

Note2: also just noticed this line in programmers.txt:

arduinoisp.program.extra_params=-P{serial.port} -b{program.speed}

So, that’s why it was using the program.speed from programmers.txt

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

Ok I don’t want to keep beating this thread up, but I do want to document my findings.

1) If you comment out the value defined in programmers.txt, and add a jnmicro.program.speed=9600 line to the custom boards.txt, it will work. If you don’t comment out the definition in programmers.txt, it WILL override the value in boards.txt
- OR -
2) modify .extra_params line in programmers.txt to read: .program.extra_params=-P{serial.port} b{upload.speed}
It seems no matter what, programmers.txt needs to be modified. Personally, I think it’s bad form that the ArduinoISP is hard coded to use 19200 baud through Programmers.txt from Arduino.cc
EDIT: to be fair, all my searches online resulted in threads of people wanting to program their Arduinos FASTER (maybe they are overclocking their chips, I can’t think of a good reason to do this… but I digress)
however, you cannot go any faster than 19200 since the arduinoisp.speed is limited to 19200. So… they may have implemented this to cap the speed that an ArduinoISP can be driven.

I doubt I have found some kind of problem though. I’m not experienced enough with this stuff to honestly say that programmers.txt is wrong and I’m right. I would like to get this corrected “the right way” to everyone’s benefit, but for now, I’m just happy it works.

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

Great work, we are all lots wiser for it.

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

Wolfpackmars2, I would like to echo JohnO and agree you have added to my knowledge. (So have you, JohnO, and Martynj). In fact I’m going to think about how to organize and present what you have learned as additional documentation to go into my fork of the jcw/ide-hardware code from GitHub. Perhaps you can take a look at it?

I’m wondering if anyone would like to send me photos of their ATTINY84 hardware and programmer setups or screen shots of programming sessions so that I can create an html page that can be referenced by the public for documentation. I want to put this folder in my GitHub fork of this code, and ultimately ask “JCW” to merge a pull request on it, so that others using the JeeNode Micro can learn from us. So if you do send me photos of your hardware and programmers and of course your comments, please consider that it will all be open sourced, and open to the public. I’d like a Creative Commons license on any image or text or source code contributions. In return, I’ll organize and rewrite all the material and present it in a nice looking web page, and I’ll edit the content as needed till you are all are satisfied.

Maybe the best way to make actual contributions in this way is to fork my fork of jcw/ide-hardware, add your content to it, and then do a pull request against my fork. (Note: I’m new to GitHub and can hardly call myself a Git expert. Not yet, anyhow. Also, I’m in learning mode in all the Arduino and Atmel chip areas, I am not an expert. So please be patient with me when I make stupid mistakes.)

Thanks a ton!

Bob

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

Hi Bob, I arranged a gathering of the programmers and am enclosing their photographs. The Bus Pirate was my first programmer and although very slow always manages to punch its way through, it can also do loads of other stuff. The USBASPv2 is probably my favorite and was the least expensive (dx.com) the firmware needed an upgrade when the JeeNode Micro 2/3 came on the scene. The USBTinyISPv2 was favorite for a long time but I don’t like the ‘floating’ power settings and powering the target separately to probably get 3v3. The MiniPro was the most expensive and it is really about burning DIL chips rather than ISP. It doesn’t integrate into the Arduino IDE as far as I know. There are two models of this device the CS and the A, the A supports an ISP style connection and the CS has a hack available to provide this otherwise unavailable feature - hardware is basically the same. The ISP interface doesn’t quite work yet on the Tiny84 family since ICSP isn’t selectable from its menu but you can read chips by setting the device to ATMEGA328.

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

Thanks a lot, JohnO! I will work with these over the weekend!

Bob

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by wolfpackmars2 over 5 years ago

My setup is a breakout board for the Freescale sensor. The sensor requires 5V, so I used an LTC3525-5 (same as the JNMicro uses, except the 5V version). It has LEDs for Battery power, 3V power and 5v power, the latter is super convenient. Since I don’t have any other LEDs on the board, I was able to troubleshoot by powering up the 5V “rail” as a sort of hi-powered blinky-LED. Otherwise, it would just sit there with two green LEDs showing me I had Batt and 3V but not actually telling me whether my sketch was doing anything.

Soldering the SC70 was a PAIN! Luckily, I ordered 3, because I burned up (suspected) the first two of these expensive components trying to get it soldered on properly. Used too much paste the first time, causing it to bridge, so I had to hand solder it. The thing is the size of a flake of pepper, with 6 legs!

I tell you, I was ecstatic the first time the red 5V led came on and the smoke remained in the board!


http://files.idatasys.net/DevSetup.JPG
http://files.idatasys.net/DevBoard.JPG
http://files.idatasys.net/DevBoardZones.JPG
http://files.idatasys.net/Separated.JPG
http://files.idatasys.net/BareBoardBack.JPG
http://files.idatasys.net/ISPProgrammer.JPG
http://files.idatasys.net/SC70Work.JPG

Use how you wish.

DevBoard.JPG (1.47 MB) DevBoard.JPG Closeup of DevBoard
BareBoardBack.JPG (1.66 MB) BareBoardBack.JPG Shot of a spare board, bottom
DevSetup.JPG (1.61 MB) DevSetup.JPG The dev setup with a spare board, top
DevBoardZones.JPG (2.37 MB) DevBoardZones.JPG Dev board populated, showing zones
ISPProgrammer.JPG (1.04 MB) ISPProgrammer.JPG ISP Jeenode Programmer
Separated.JPG (1.12 MB) Separated.JPG Jeenode Separated from Dev Board
SC70Work.JPG (1.56 MB) SC70Work.JPG Terrorist SC-70 :P
SC70Work_L.jpg (288 KB) SC70Work_L.jpg
1598
1599
1600
1601
1602
1603
1604
1619

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by Rolf over 5 years ago

Hi guys,

was already a bit desperate with all the hardware- and software-hacks needed to program a jeenode micro. And was ready to cry for help in the forum. Then I found this discussion and finally succeeded. THANKS A LOT!

I had the same problem as Henry, “forgot” to upload the isp-flash.ino sketch first. I think a hint to this step should be put in the manual.

Because its not that I forgot it, I did not check it, being totally unexperienced with ISP-programmers.

Thanks again,

Rolf

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by BobCochran13 over 5 years ago

@JohnO and wolfpackmars2

Thanks a lot for the photos. I have just started working with them a little. All the photos have been added to my fork of ide-hardware. They are in a folder named hardware_example_photos.

https://github.com/BobCochran/ide-hardware

I plan to do much more with them than just put photos inside a folder. I want to make html pages that display the photos, so that someone can can bring them up on a browser quickly. I will edit the photos so one can get both low and high resolution versions. I would like to quote some of your comments on the photos and ask for a little more detail about how to use JeeNodes with these programmers and development boards. JohnO — can you please tell me which of your boards you are using for JeeNode work?

Wolfpackmars2 — the dev board you are using is called what? Where did you get it from? Can you explain what an SC70 is for? (Please forgive me if the questions are a bit silly…I’m new to this.) I notice a clear plastic tube coming connected to the dev board in the photo, what is that for?

@Rolf, I believe that my fork of the ide-hardware download has a comment in the README.md that you have to use the isp-flash.ino sketch on the JeeNode device that is intended to be the programmer. If it turns out this detail is missing, I will be sure to add it — thanks for the heads up!

Kind regards

Bob

RE: Resolved: Problem to program a Jeenode Micro (please help) - Added by JohnO over 5 years ago

Hi Bob, I use or have used all of my programming boards with my JeeNodes. My current first choice for the Micro is USBASPv2. I use the MiniPro for ATMEGA328 boot-loaders and for DIL Tiny84 devices. If I were to struggle with either of them I go to the Bus Pirate as it always seems to work albeit slowly. I no longer like the USTinyISPv2 because of the provisions required to avoid 5v hitting the RFM12B.

(26-50/72)