That would be useful, though the ideal one would be for it to try to negotiate the maximum power possible (500ma for the internal polyfuse), but even if it can't get it, store the current max power in eeprom (presumably given it's only 8 bits, store it in terms of unit loads (100 ma) ).
Then you could know in the sketch to use e.g. a lower PWM cycle, or something. Your 2 different board definitions is probably the easiest way for now though!
Building Arduino 1.0.1 Bootloader for Leostick
Re: Building Arduino 1.0.1 Bootloader for Leostick
Problem solved, I believe for the moment regarding adjusting usbMaxPower within a Sketch.
Refer to the new thread I started: viewtopic.php?f=27&t=679
I've also updated the leostick.zip file - so if you have downloaded it previously might want to grab a new copy
Refer to the new thread I started: viewtopic.php?f=27&t=679
I've also updated the leostick.zip file - so if you have downloaded it previously might want to grab a new copy
- jonoxer
- Freetronics Staff
- Posts:298
- Joined:Sat Oct 15, 2011 11:31 am
- Location:Melbourne, Australia
- Contact:
Re: Building Arduino 1.0.1 Bootloader for Leostick
Hey @adr1an, that's excellent work you did with the Caterina bootloader!
We've now switched to Caterina ourselves so the last thousand or so LeoSticks have shipped with the Caterina bootloader and our own officially registered VID/PID, and I've created a new board profile specifically for the LeoStick + Caterina combo. I've also created a unified .inf file that includes the VID/PID pairs used on every device we've ever shipped, to make it easier to install if you're using Windows.
There's more info here:
viewtopic.php?f=27&t=285&start=10#p3312
--
Jon
We've now switched to Caterina ourselves so the last thousand or so LeoSticks have shipped with the Caterina bootloader and our own officially registered VID/PID, and I've created a new board profile specifically for the LeoStick + Caterina combo. I've also created a unified .inf file that includes the VID/PID pairs used on every device we've ever shipped, to make it easier to install if you're using Windows.
There's more info here:
viewtopic.php?f=27&t=285&start=10#p3312
--
Jon
-
- Posts:10
- Joined:Mon Dec 10, 2012 11:13 pm
- Location:my house
- Contact:
Re: Building Arduino 1.0.1 Bootloader for Leostick
can you make the bootloader time longer than the original, i try to upload a sketch but the old one starts running too soon
Re: Building Arduino 1.0.1 Bootloader for Leostick
Here's a question for adr1an or anyone with some ideas about getting analogWrite to work on the red LED pin, 13,
Firstly, you give great instructions for building a new bootloader, but can you give simpler instructions for how to use the files you uploaded without rebuilding anything? Sorry if that's a stupid question, I get that you'd put the bootloader.zip items under (windows)
C:\Users\<name>\Documents\Arduino\hardware\LeoStick_v1_0
But what then? Can I burn a shiny new Caterina bootloader into my LeoStick with just Arduino 1.0.3 ide (if so, how?), or do I need to solder the ICSP header onto the thing and go find some additional hardware to burn a new bootloader into it?
I also see that if you change the bootloader, a new .inf file would be necessary, hence the new LeoStick_Bootloader_driver.zip
Secondly, is all this even necessary...
I'm just messing around with a leostick I got from JayCar, and simply trying to get analogWrite to work on D13, the red LED.
Another fellow mentioned that "new firmware" was needed, and pointed to this post, but from my understanding of how Adruinos work, whether you can use analogWrite on a particular pin is a function of a configuration or source file somewhere, not which bootloader is loaded.
If it is indeed true that a new bootloader is needed simply to support analogWrite on D13, can you explain the mechanism of that requirement? I wouldn't have thought it had anything to do with the bootloader, but with the cores code contained under:
C:\Users\Joe\Documents\Arduino\hardware\LeoStick_v1_0\cores\arduino...
Perhaps in wiring_analog.c, where there's a comment:
// Right now, PWM output only works on the pins with
// hardware support. These are defined in the appropriate
// pins_*.c file. For the rest of the pins, we default
// to digital output.
Except that this part DOES have PWM output available on pin 13!
Where is pins_(chipname?).c located?
Thanks in advance for any light you can shed on this. Always learning...
Firstly, you give great instructions for building a new bootloader, but can you give simpler instructions for how to use the files you uploaded without rebuilding anything? Sorry if that's a stupid question, I get that you'd put the bootloader.zip items under (windows)
C:\Users\<name>\Documents\Arduino\hardware\LeoStick_v1_0
But what then? Can I burn a shiny new Caterina bootloader into my LeoStick with just Arduino 1.0.3 ide (if so, how?), or do I need to solder the ICSP header onto the thing and go find some additional hardware to burn a new bootloader into it?
I also see that if you change the bootloader, a new .inf file would be necessary, hence the new LeoStick_Bootloader_driver.zip
Secondly, is all this even necessary...
I'm just messing around with a leostick I got from JayCar, and simply trying to get analogWrite to work on D13, the red LED.
Another fellow mentioned that "new firmware" was needed, and pointed to this post, but from my understanding of how Adruinos work, whether you can use analogWrite on a particular pin is a function of a configuration or source file somewhere, not which bootloader is loaded.
If it is indeed true that a new bootloader is needed simply to support analogWrite on D13, can you explain the mechanism of that requirement? I wouldn't have thought it had anything to do with the bootloader, but with the cores code contained under:
C:\Users\Joe\Documents\Arduino\hardware\LeoStick_v1_0\cores\arduino...
Perhaps in wiring_analog.c, where there's a comment:
// Right now, PWM output only works on the pins with
// hardware support. These are defined in the appropriate
// pins_*.c file. For the rest of the pins, we default
// to digital output.
Except that this part DOES have PWM output available on pin 13!
Where is pins_(chipname?).c located?
Thanks in advance for any light you can shed on this. Always learning...
Re: Building Arduino 1.0.1 Bootloader for Leostick
In my quest for getting PWM to work with Pin D13, I've made up a freetronics-eleven based ISP jig that plugs onto the 6 pin programming header on the LeoStick, but a question has arisen.
There are two hex files under the bootloaders directory that adr1an published in the file leostick.zip
Caterina-Leonardo.hex, and
Caterina-LeoStick.hex
So when one selects Arduino ISP as the programmer, then selects the Freetronics LeoStick as the board (which finds it under hardware in the sketchbook directory?) and then selects "burn bootloader" from the IDE, which of the two files does the PC-side burn program select, and what criteria does it use to decide which one to select?
There are two hex files under the bootloaders directory that adr1an published in the file leostick.zip
Caterina-Leonardo.hex, and
Caterina-LeoStick.hex
So when one selects Arduino ISP as the programmer, then selects the Freetronics LeoStick as the board (which finds it under hardware in the sketchbook directory?) and then selects "burn bootloader" from the IDE, which of the two files does the PC-side burn program select, and what criteria does it use to decide which one to select?
Re: Building Arduino 1.0.1 Bootloader for Leostick
I'm guessing that it reads boards.txt which has a line it:sleat wrote: There are two hex files under the bootloaders directory that adr1an published in the file leostick.zip
Caterina-Leonardo.hex, and
Caterina-LeoStick.hex
So when one selects Arduino ISP as the programmer, then selects the Freetronics LeoStick as the board (which finds it under hardware in the sketchbook directory?) and then selects "burn bootloader" from the IDE, which of the two files does the PC-side burn program select, and what criteria does it use to decide which one to select?
leostick.bootloader.path=caterina
leostick.bootloader.file=Caterina-Leostick.hex
Re: Building Arduino 1.0.1 Bootloader for Leostick
Did you ever figure this out? I'm wondering the same thing at the moment.sleat wrote: But what then? Can I burn a shiny new Caterina bootloader into my LeoStick with just Arduino 1.0.3 ide (if so, how?), or do I need to solder the ICSP header onto the thing and go find some additional hardware to burn a new bootloader into it?
-
- Freetronics Staff
- Posts:853
- Joined:Tue Apr 09, 2013 11:19 pm
- Location:Melbourne, Australia
- Contact:
Re: Building Arduino 1.0.1 Bootloader for Leostick
You need a second piece of hardware, unfortunately. It can be a second Arduino-compatible device, though. If you install the new official LeoStick board profile v3.3, there is an overview of the upgrade process here.wintrmute wrote: sleat wrote:But what then? Can I burn a shiny new Caterina bootloader into my LeoStick with just Arduino 1.0.3 ide (if so, how?), or do I need to solder the ICSP header onto the thing and go find some additional hardware to burn a new bootloader into it?
Did you ever figure this out? I'm wondering the same thing at the moment.