Go Down

Topic: Question on difference between bootloaders? (Read 6 times) previous topic - next topic

xl97

Thanks for the reply.


Im not sure I understand 100%.. so let me try to regurgitate it back to you and see what Im missing here.. :)


1.) because I successfully flashed Optiboot (using the Otiloader sketch.. that auto detects chip signature) in a jig/circuit that was set-up with 16MHz external crystal,..... I can just take that chip out.. and pop it into the 'final' circuit that is set-up to use an 8MHz external resonator.. and have ZERO problems? side effects?......nothing??



2.) There is no 'pre-existing' entry in the boards menu in the Arduino IDE for ANYTHING Optiboot related?  16Mhz or 8Mhz??
(kinda lost on that one I guess?)

I think there is actually 2 piece of info there that are useful (even if not usable currently) from the rest of you post:


A.)
Quote

There is no pre-existing definition in the Arduino IDE for a board with Optiboot at 8MHz, but it's easy to add one:  Find the boards.txt file and duplicate the uno definition (the first block of text).  Change the uno prefix in the duplicated text to something else, change upload.speed to 57600, change f_cpu to 8000000L, and change name to something else.


I would do/follow the above process if:
    i.) I had an 8Mhz set-up (including crystal/resonator).. and wanted to flash Optiboot bootloader to a blank chip that is intended to run @ +3.3v & 8Mhz clock....yes?

(because Optiboot doesnt by default have a 8Mhz entry to use/burn)... correct?


B.)
Quote

Likewise you can burn a bootloader binary made for an 8MHz board onto a chip running at 16MHz.  To test it with the 16MHz crystal you just need to upload at twice the normal baud, and to do that you make a new entry in boards.txt as described above.


now this seems like an answer to addresses my current situation/problem...(correct?)

I would do/follow the above process if: (like my current situation)
    i.) I have a 16Mhz set-up for FLASHING the BOOTLOADER to the chip.. but in the end the FINAL circuit the chip will go into is a 8Mhz set-up?



So if I was to follow the above..

I would be making 2 NEW bootloader entries:

1.)   8Mhz  >> 8Mhz  Optiboot

and a

2.) 16Mhz >> 8Mhz Optiboot


entry.......yes?

and in theory.. (taking this another step)..

if my flashing/bootloader 'jig' was ONLY set-up as a 8Mhz set-up.... but the target chip was eventually going to go into a 16Mhz set-up..

I could make another (3rd) entry..

3.) 8Mhz >> 16Mhz Optiboot..

(or can you NOT be compatible that way?  8Mhz to 16Mhz?)



am I following you correctly so far?


And all this is done by duplicating the UNO (Optiboot) entry and renaming, and changing the upload rate?


and again.. no side-effects/problems flashing in one environment and using in another?


so giving it a try:.

here are my two new BOARDS.txt entries..


1 x straight 8Mhz   (flashed in 8MHz circuit and used in final 8MHz circuit)
1 x 16Mhz to 8Mhz  (flashed in 16MHz circuit and used in final 8MHz circuit)



Quote

optiboot_8MHz.name=Optiboot @ 8MHz
optiboot_8MHz.upload.protocol=arduino
optiboot_8MHz.upload.maximum_size=32256
optiboot_8MHz.upload.speed=57600
optiboot_8MHz.bootloader.low_fuses=0xff
optiboot_8MHz.bootloader.high_fuses=0xde
optiboot_8MHz.bootloader.extended_fuses=0x05
optiboot_8MHz.bootloader.path=optiboot
optiboot_8MHz.bootloader.file=optiboot_atmega328.hex
optiboot_8MHz.bootloader.unlock_bits=0x3F
optiboot_8MHz.bootloader.lock_bits=0x0F
optiboot_8MHz.build.mcu=atmega328p
optiboot_8MHz.build.f_cpu=8000000L
optiboot_8MHz.build.core=arduino
optiboot_8MHz.build.variant=standard





optiboot_16-8MHz.name=Optiboot 16MHz >> 8MHz
optiboot_16-8MHz.upload.protocol=arduino
optiboot_16-8MHz.upload.maximum_size=32256
optiboot_16-8MHz.upload.speed=115200
optiboot_16-8MHz.bootloader.low_fuses=0xff
optiboot_16-8MHz.bootloader.high_fuses=0xde
optiboot_16-8MHz.bootloader.extended_fuses=0x05
optiboot_16-8MHz.bootloader.path=optiboot
optiboot_16-8MHz.bootloader.file=optiboot_atmega328.hex
optiboot_16-8MHz.bootloader.unlock_bits=0x3F
optiboot_16-8MHz.bootloader.lock_bits=0x0F
optiboot_16-8MHz.build.mcu=atmega328p
optiboot_16-8MHz.build.f_cpu=8000000L
optiboot_16-8MHz.build.core=arduino
optiboot_16-8MHz.build.variant=standard



thanks!



@pito-

thanks for reply too!  :)

pito

Quote
optiboot_16-8MHz.upload.speed=115200

You cannot run 115k2 upload with 8MHz clock reliably. The max recommended is 57k6..

tim7


1.) because I successfully flashed Optiboot (using the Otiloader sketch.. that auto detects chip signature) in a jig/circuit that was set-up with 16MHz external crystal,..... I can just take that chip out.. and pop it into the 'final' circuit that is set-up to use an 8MHz external resonator.. and have ZERO problems? side effects?......nothing??


That's right.  The only extra thing you'll have to do is add an extra entry in boards.txt.  You have installed an Optiboot binary which is made for running at 16MHz.  It will still run at 8MHz, but at half the speed.  The only change you have to make is ensure that the communications coming from your PC are also running at half the normal speed.

Quote

2.) There is no 'pre-existing' entry in the boards menu in the Arduino IDE for ANYTHING Optiboot related?  16Mhz or 8Mhz??


No, that's not right.  The Uno, the Arduino Mini, and the Arduino Ethernet all use Optiboot at 16MHz.

Quote

now this seems like an answer to addresses my current situation/problem...(correct?)


I'm not quite sure that your current problem is.  If you've got Optiboot running, isn't that enough?

xl97


Quote
optiboot_16-8MHz.upload.speed=115200

You cannot run 115k2 upload with 8MHz clock reliably. The max recommended is 57k6..


thanks.


so then what wold be the difference between the two??  (none?)


pito

1. if you flash an "optiboot for 8MHz and 57k6" and run the chip @16MHz the upload baudrate will be 115k2 - ok
2. if you flash an "optiboot for 16MHz and 115k2" and run the chip @8MHz the upload baudrate will be 57k6 - ok



Go Up