Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. OpenHardware.io
  3. 💬 Various bootloader files based on Optiboot 6.2

💬 Various bootloader files based on Optiboot 6.2

Scheduled Pinned Locked Moved OpenHardware.io
optiboot
164 Posts 18 Posters 63.7k Views 18 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • carlierdC carlierd

    @GertSanders

    Hello, as I got some issue with the 1MHz bootloader, I tried without the signing feature and I still got st=fail.

    One question for you, perhaps stupid but I need to be sure ;)
    Do you need to set the same serial speed on both node and gateway ?

    David.

    GertSandersG Offline
    GertSandersG Offline
    GertSanders
    Hardware Contributor
    wrote on last edited by
    #61

    @carlierd
    No, the serial speed is not something relevant for the radio communication.
    When I compile the boot loader, I just need to choose the CPU frequency and make sure I also choose an upload speed which is compatible with that CPU frequency. Some combinations of CPU frequency and upload speed give errors and the error rate of the serial upload communication can not be above 2% or AVRDUDE will fail.
    For node to gateway communication (and your ST=FAIL errors) this is not relevant.
    ST=FAIL errors can (in my case) be reduced by lowering the power output of the radio on the node (is default set to MAX, I put it mostly to HIGH).
    st=fail errors can also be the result of poor power to the radio.

    alexsh1A 1 Reply Last reply
    0
    • GertSandersG GertSanders

      @carlierd
      No, the serial speed is not something relevant for the radio communication.
      When I compile the boot loader, I just need to choose the CPU frequency and make sure I also choose an upload speed which is compatible with that CPU frequency. Some combinations of CPU frequency and upload speed give errors and the error rate of the serial upload communication can not be above 2% or AVRDUDE will fail.
      For node to gateway communication (and your ST=FAIL errors) this is not relevant.
      ST=FAIL errors can (in my case) be reduced by lowering the power output of the radio on the node (is default set to MAX, I put it mostly to HIGH).
      st=fail errors can also be the result of poor power to the radio.

      alexsh1A Offline
      alexsh1A Offline
      alexsh1
      wrote on last edited by
      #62

      @GertSanders said:

      ST=FAIL errors can (in my case) be reduced by lowering the power output of the radio on the node (is default set to MAX, I put it mostly to HIGH).
      st=fail errors can also be the result of poor power to the radio.

      Or just a bad radio. There is a huge thread on the forum about fake radio modules.
      I have gone through quite a few - what a waste of time....

      1 Reply Last reply
      0
      • carlierdC Offline
        carlierdC Offline
        carlierd
        wrote on last edited by
        #63

        I am using RFM69. No fake as it's working perfectly at other frequency.

        @GertSanders
        I tried three different configurations:

        • 16 MHz with crystal
        • 8 MHz internal
        • 1 MHz internal (with some st=fail)

        I measured power consumption in sleep mode and found that it's very close to 4uA with all configurations. So why using the 1 MHz ? Do you have better consumption when using 1 MHz ?

        The best configuration for me will be the 8 MHz internal as it avoid to used the crystal.

        David.

        GertSandersG S 2 Replies Last reply
        0
        • carlierdC carlierd

          I am using RFM69. No fake as it's working perfectly at other frequency.

          @GertSanders
          I tried three different configurations:

          • 16 MHz with crystal
          • 8 MHz internal
          • 1 MHz internal (with some st=fail)

          I measured power consumption in sleep mode and found that it's very close to 4uA with all configurations. So why using the 1 MHz ? Do you have better consumption when using 1 MHz ?

          The best configuration for me will be the 8 MHz internal as it avoid to used the crystal.

          David.

          GertSandersG Offline
          GertSandersG Offline
          GertSanders
          Hardware Contributor
          wrote on last edited by
          #64

          @carlierd
          In sleep mode it does not matter which frequency is used. The watchdog timer runs off its own clock and that is the same for all three cases. The fact that you get around 4 uA is just because you still have a watchdogtimer running. With full deep sleep and complete shutdown of the radio we should see 1-2 uA if external pullup of more then 2MOhm is used.
          The mcu frequency is important for the active time. Higher frequency means faster startup and faster completion of tasks.
          8Mhz is a good compromise as the internal oscillator is less powerhungry then fullswing crystal.
          And you need less parts.

          carlierdC 2 Replies Last reply
          0
          • carlierdC carlierd

            I am using RFM69. No fake as it's working perfectly at other frequency.

            @GertSanders
            I tried three different configurations:

            • 16 MHz with crystal
            • 8 MHz internal
            • 1 MHz internal (with some st=fail)

            I measured power consumption in sleep mode and found that it's very close to 4uA with all configurations. So why using the 1 MHz ? Do you have better consumption when using 1 MHz ?

            The best configuration for me will be the 8 MHz internal as it avoid to used the crystal.

            David.

            S Offline
            S Offline
            Samuel235
            Hardware Contributor
            wrote on last edited by
            #65

            @carlierd, all that i can say is; do not rely on serial communication working. I'm running my custom made node on 8MHz internal, can use the serial monitor but i can not upload via serial. Only ISP uploads using programmer.

            MySensors 2.1.1
            Controller - OpenHAB (Virtual Machine)
            Gateway - Arduino Mega MQTT Gateway W5100

            GertSandersG carlierdC 2 Replies Last reply
            0
            • S Samuel235

              @carlierd, all that i can say is; do not rely on serial communication working. I'm running my custom made node on 8MHz internal, can use the serial monitor but i can not upload via serial. Only ISP uploads using programmer.

              GertSandersG Offline
              GertSandersG Offline
              GertSanders
              Hardware Contributor
              wrote on last edited by
              #66

              @Samuel235
              I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.

              S 1 Reply Last reply
              1
              • GertSandersG GertSanders

                @Samuel235
                I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.

                S Offline
                S Offline
                Samuel235
                Hardware Contributor
                wrote on last edited by
                #67

                @GertSanders said:

                @Samuel235
                I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.

                I've been told that it should work but atmel do not advise it or support it apparently. There are chances that it wont work and mine doesn't. I had the discussion regarding it in my nodes topic but the conversation just dropped off and went stale.

                MySensors 2.1.1
                Controller - OpenHAB (Virtual Machine)
                Gateway - Arduino Mega MQTT Gateway W5100

                GertSandersG 1 Reply Last reply
                0
                • S Samuel235

                  @GertSanders said:

                  @Samuel235
                  I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.

                  I've been told that it should work but atmel do not advise it or support it apparently. There are chances that it wont work and mine doesn't. I had the discussion regarding it in my nodes topic but the conversation just dropped off and went stale.

                  GertSandersG Offline
                  GertSandersG Offline
                  GertSanders
                  Hardware Contributor
                  wrote on last edited by
                  #68

                  @Samuel235
                  That depends on the upload speed. At higher speeds the error on the frequency of the internal oscillator gets more important. It can be off by several percent (from 8mhz) and then avrdude can fail. I have experimented with 9600 baud and there the deviation of the internal 8mhz has to be severe before the serial uploads starts to feel the effect.
                  So try using a 8Mhz boot loader prepared for an 9600 baud upload.

                  S 1 Reply Last reply
                  0
                  • GertSandersG GertSanders

                    @Samuel235
                    That depends on the upload speed. At higher speeds the error on the frequency of the internal oscillator gets more important. It can be off by several percent (from 8mhz) and then avrdude can fail. I have experimented with 9600 baud and there the deviation of the internal 8mhz has to be severe before the serial uploads starts to feel the effect.
                    So try using a 8Mhz boot loader prepared for an 9600 baud upload.

                    S Offline
                    S Offline
                    Samuel235
                    Hardware Contributor
                    wrote on last edited by
                    #69

                    @GertSanders, i did do, that's the latest solution i tried. No joy.

                    MySensors 2.1.1
                    Controller - OpenHAB (Virtual Machine)
                    Gateway - Arduino Mega MQTT Gateway W5100

                    GertSandersG 1 Reply Last reply
                    0
                    • GertSandersG GertSanders

                      @carlierd
                      In sleep mode it does not matter which frequency is used. The watchdog timer runs off its own clock and that is the same for all three cases. The fact that you get around 4 uA is just because you still have a watchdogtimer running. With full deep sleep and complete shutdown of the radio we should see 1-2 uA if external pullup of more then 2MOhm is used.
                      The mcu frequency is important for the active time. Higher frequency means faster startup and faster completion of tasks.
                      8Mhz is a good compromise as the internal oscillator is less powerhungry then fullswing crystal.
                      And you need less parts.

                      carlierdC Offline
                      carlierdC Offline
                      carlierd
                      wrote on last edited by
                      #70

                      @GertSanders Thanks for explanation. It confirms what I imagine !

                      I am using a 10MOhm resistor but not the full deep sleep as I want to periodically send the battery.
                      I will try it because 1-2 uA is very low ;)

                      1 Reply Last reply
                      0
                      • S Samuel235

                        @carlierd, all that i can say is; do not rely on serial communication working. I'm running my custom made node on 8MHz internal, can use the serial monitor but i can not upload via serial. Only ISP uploads using programmer.

                        carlierdC Offline
                        carlierdC Offline
                        carlierd
                        wrote on last edited by
                        #71

                        @Samuel235 No issue to with the FTDI.
                        I just found a small problem due to the Arduino IDE. As I often change board (from UNO to different bootloader) I discover that the menu is sometime not coherent with the real setting. So I found that selecting two or three times board parameters (including port) is the solution to avoid communication issue.

                        1 Reply Last reply
                        0
                        • S Samuel235

                          @GertSanders, i did do, that's the latest solution i tried. No joy.

                          GertSandersG Offline
                          GertSandersG Offline
                          GertSanders
                          Hardware Contributor
                          wrote on last edited by
                          #72

                          @Samuel235
                          Would you want to try a bootloader with an upload speed of 4800 ? I can make that for 8Mhz if you want (just to test)?

                          S 1 Reply Last reply
                          0
                          • GertSandersG GertSanders

                            @Samuel235
                            Would you want to try a bootloader with an upload speed of 4800 ? I can make that for 8Mhz if you want (just to test)?

                            S Offline
                            S Offline
                            Samuel235
                            Hardware Contributor
                            wrote on last edited by
                            #73

                            @GertSanders, that would be fantastic if you wouldn't mind. Its for my in wall light switch custom made node that you're following. Thanks you, much appreciated.

                            MySensors 2.1.1
                            Controller - OpenHAB (Virtual Machine)
                            Gateway - Arduino Mega MQTT Gateway W5100

                            GertSandersG 2 Replies Last reply
                            0
                            • S Samuel235

                              @GertSanders, that would be fantastic if you wouldn't mind. Its for my in wall light switch custom made node that you're following. Thanks you, much appreciated.

                              GertSandersG Offline
                              GertSandersG Offline
                              GertSanders
                              Hardware Contributor
                              wrote on last edited by GertSanders
                              #74

                              @Samuel235

                              here is the boot loader in 2 versions: one will flash port PB0 and the other does not.

                              You need to use the following fuse settings in the board file:

                              bootloader.low_fuses=0xE2
                              bootloader.high_fuses=0xDE
                              bootloader.extended_fuses=0x06

                              1_1458903521561_optiboot_atmega328_08M_004800_NOLED.hex

                              0_1458903521561_optiboot_atmega328_08M_004800_B0.hex

                              I saw that you use high fuse 0xDA

                              I'm assuming you use a boot loader larger then 512 bytes. Optiboot fits inside 512 bytes, so we need to define a space of 256 words (1 word = 2 bytes in AVR 8bit).

                              1 Reply Last reply
                              0
                              • S Samuel235

                                @GertSanders, that would be fantastic if you wouldn't mind. Its for my in wall light switch custom made node that you're following. Thanks you, much appreciated.

                                GertSandersG Offline
                                GertSandersG Offline
                                GertSanders
                                Hardware Contributor
                                wrote on last edited by
                                #75

                                @Samuel235

                                For my boot loaders based on Optiboot 6.2, I normally use high fuse set to 0xDE

                                Extract from my boards.txt file:

                                menu.mhz=CPU Speed
                                menu.bod=Brown Out Detection

                                28PinBoard.name=atmega328p based - 28 pin DIL

                                28PinBoard.upload.tool=arduino:avrdude
                                28PinBoard.upload.protocol=arduino
                                28PinBoard.upload.maximum_size=32256
                                28PinBoard.upload.maximum_data_size=2048

                                28PinBoard.bootloader.tool=arduino:avrdude

                                28PinBoard.bootloader.unlock_bits=0x3F
                                28PinBoard.bootloader.lock_bits=0x0F

                                28PinBoard.build.core=arduino:arduino
                                28PinBoard.build.mcu=atmega328p

                                28PinBoard.build.board=AVR_GERTSANDERS28PinBoard
                                28PinBoard.build.variant=28PinBoard

                                28PinBoard.menu.bod.4v3=4V3
                                28PinBoard.menu.bod.4v3.bootloader.extended_fuses=0x04
                                28PinBoard.menu.bod.2v7=2V7
                                28PinBoard.menu.bod.2v7.bootloader.extended_fuses=0x05
                                28PinBoard.menu.bod.1v8=1V8
                                28PinBoard.menu.bod.1v8.bootloader.extended_fuses=0x06
                                28PinBoard.menu.bod.off=Disabled
                                28PinBoard.menu.bod.off.bootloader.extended_fuses=0x07

                                28PinBoard.menu.mhz.8Mi-38K4-D8= 8Mhz - internal - 38K4 - D8
                                28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.low_fuses=0xE2
                                28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.high_fuses=0xDE
                                28PinBoard.menu.mhz.8Mi-38K4-D8.build.f_cpu=8000000L
                                28PinBoard.menu.mhz.8Mi-38K4-D8.upload.speed=38400
                                28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.file=myoptiboot/optiboot_atmega328_08M_038400_B0.hex

                                S 2 Replies Last reply
                                0
                                • GertSandersG GertSanders

                                  @Samuel235

                                  For my boot loaders based on Optiboot 6.2, I normally use high fuse set to 0xDE

                                  Extract from my boards.txt file:

                                  menu.mhz=CPU Speed
                                  menu.bod=Brown Out Detection

                                  28PinBoard.name=atmega328p based - 28 pin DIL

                                  28PinBoard.upload.tool=arduino:avrdude
                                  28PinBoard.upload.protocol=arduino
                                  28PinBoard.upload.maximum_size=32256
                                  28PinBoard.upload.maximum_data_size=2048

                                  28PinBoard.bootloader.tool=arduino:avrdude

                                  28PinBoard.bootloader.unlock_bits=0x3F
                                  28PinBoard.bootloader.lock_bits=0x0F

                                  28PinBoard.build.core=arduino:arduino
                                  28PinBoard.build.mcu=atmega328p

                                  28PinBoard.build.board=AVR_GERTSANDERS28PinBoard
                                  28PinBoard.build.variant=28PinBoard

                                  28PinBoard.menu.bod.4v3=4V3
                                  28PinBoard.menu.bod.4v3.bootloader.extended_fuses=0x04
                                  28PinBoard.menu.bod.2v7=2V7
                                  28PinBoard.menu.bod.2v7.bootloader.extended_fuses=0x05
                                  28PinBoard.menu.bod.1v8=1V8
                                  28PinBoard.menu.bod.1v8.bootloader.extended_fuses=0x06
                                  28PinBoard.menu.bod.off=Disabled
                                  28PinBoard.menu.bod.off.bootloader.extended_fuses=0x07

                                  28PinBoard.menu.mhz.8Mi-38K4-D8= 8Mhz - internal - 38K4 - D8
                                  28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.low_fuses=0xE2
                                  28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.high_fuses=0xDE
                                  28PinBoard.menu.mhz.8Mi-38K4-D8.build.f_cpu=8000000L
                                  28PinBoard.menu.mhz.8Mi-38K4-D8.upload.speed=38400
                                  28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.file=myoptiboot/optiboot_atmega328_08M_038400_B0.hex

                                  S Offline
                                  S Offline
                                  Samuel235
                                  Hardware Contributor
                                  wrote on last edited by
                                  #76

                                  @GertSanders I used that DA high fuse simply to make sure the default bootloader fitted, however if its too big will it cause issues on serial ipload even if its a very small upload? Could that be the reason?

                                  I will try your bootloader without the LED as my module doesn't contain the LED. This is very hard to read from a mobile device so i will attempt this when i get home tonight. Thank you once again for your files and time.

                                  MySensors 2.1.1
                                  Controller - OpenHAB (Virtual Machine)
                                  Gateway - Arduino Mega MQTT Gateway W5100

                                  1 Reply Last reply
                                  0
                                  • GertSandersG GertSanders

                                    @carlierd
                                    In sleep mode it does not matter which frequency is used. The watchdog timer runs off its own clock and that is the same for all three cases. The fact that you get around 4 uA is just because you still have a watchdogtimer running. With full deep sleep and complete shutdown of the radio we should see 1-2 uA if external pullup of more then 2MOhm is used.
                                    The mcu frequency is important for the active time. Higher frequency means faster startup and faster completion of tasks.
                                    8Mhz is a good compromise as the internal oscillator is less powerhungry then fullswing crystal.
                                    And you need less parts.

                                    carlierdC Offline
                                    carlierdC Offline
                                    carlierd
                                    wrote on last edited by
                                    #77

                                    @GertSanders Hello. I tried the full deep sleep and it's really amazing !

                                    I used your 8MHz with internal crystal and B0 led, BOD disabled. RFM69 for radio and just a switch via a 10MOhm resistor.
                                    With the switch open: 280nA
                                    With the switch close: 580nA

                                    Measures done with a uCurrent Gold.
                                    So I am sure now that I found the good bootloader for my application. It's simple to install and I can change easily the BOD !
                                    Thanks !

                                    GertSandersG 1 Reply Last reply
                                    1
                                    • carlierdC carlierd

                                      @GertSanders Hello. I tried the full deep sleep and it's really amazing !

                                      I used your 8MHz with internal crystal and B0 led, BOD disabled. RFM69 for radio and just a switch via a 10MOhm resistor.
                                      With the switch open: 280nA
                                      With the switch close: 580nA

                                      Measures done with a uCurrent Gold.
                                      So I am sure now that I found the good bootloader for my application. It's simple to install and I can change easily the BOD !
                                      Thanks !

                                      GertSandersG Offline
                                      GertSandersG Offline
                                      GertSanders
                                      Hardware Contributor
                                      wrote on last edited by
                                      #78

                                      @carlierd
                                      Great to hear those low consumption numbers.

                                      carlierdC 1 Reply Last reply
                                      0
                                      • GertSandersG GertSanders

                                        @carlierd
                                        Great to hear those low consumption numbers.

                                        carlierdC Offline
                                        carlierdC Offline
                                        carlierd
                                        wrote on last edited by
                                        #79

                                        @GertSanders
                                        Yes, very impressive ! But finally not a lot of difference with the same node using interruption and sleep.
                                        The auto-discharge of AA batteries is really important compare to node consumption.

                                        David.

                                        1 Reply Last reply
                                        0
                                        • GertSandersG GertSanders

                                          @Samuel235

                                          For my boot loaders based on Optiboot 6.2, I normally use high fuse set to 0xDE

                                          Extract from my boards.txt file:

                                          menu.mhz=CPU Speed
                                          menu.bod=Brown Out Detection

                                          28PinBoard.name=atmega328p based - 28 pin DIL

                                          28PinBoard.upload.tool=arduino:avrdude
                                          28PinBoard.upload.protocol=arduino
                                          28PinBoard.upload.maximum_size=32256
                                          28PinBoard.upload.maximum_data_size=2048

                                          28PinBoard.bootloader.tool=arduino:avrdude

                                          28PinBoard.bootloader.unlock_bits=0x3F
                                          28PinBoard.bootloader.lock_bits=0x0F

                                          28PinBoard.build.core=arduino:arduino
                                          28PinBoard.build.mcu=atmega328p

                                          28PinBoard.build.board=AVR_GERTSANDERS28PinBoard
                                          28PinBoard.build.variant=28PinBoard

                                          28PinBoard.menu.bod.4v3=4V3
                                          28PinBoard.menu.bod.4v3.bootloader.extended_fuses=0x04
                                          28PinBoard.menu.bod.2v7=2V7
                                          28PinBoard.menu.bod.2v7.bootloader.extended_fuses=0x05
                                          28PinBoard.menu.bod.1v8=1V8
                                          28PinBoard.menu.bod.1v8.bootloader.extended_fuses=0x06
                                          28PinBoard.menu.bod.off=Disabled
                                          28PinBoard.menu.bod.off.bootloader.extended_fuses=0x07

                                          28PinBoard.menu.mhz.8Mi-38K4-D8= 8Mhz - internal - 38K4 - D8
                                          28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.low_fuses=0xE2
                                          28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.high_fuses=0xDE
                                          28PinBoard.menu.mhz.8Mi-38K4-D8.build.f_cpu=8000000L
                                          28PinBoard.menu.mhz.8Mi-38K4-D8.upload.speed=38400
                                          28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.file=myoptiboot/optiboot_atmega328_08M_038400_B0.hex

                                          S Offline
                                          S Offline
                                          Samuel235
                                          Hardware Contributor
                                          wrote on last edited by
                                          #80

                                          @GertSanders, I have just managed to make time to remake a node and troubleshoot its upload issues with your suggested solution. So i went a head, got everything made up the minimal version, MCU, caps, and programming headers. I made sure all connections were working fine, they were. I then read the fuses, all fine and dandy. I then burnt your suggested fuses of;

                                          bootloader.low_fuses=0xE2
                                          bootloader.high_fuses=0xDE
                                          bootloader.extended_fuses=0x06
                                          

                                          Then the problem came. I lost all contact to the node, tried slowing the clock rate down on AVRDUDE to read it, nothing. I've hooked up my crystal just in case it burnt it incorrectly and thought it had an external crystal, nothing there either.

                                          I'll be honest, i'm a little confused.

                                          MySensors 2.1.1
                                          Controller - OpenHAB (Virtual Machine)
                                          Gateway - Arduino Mega MQTT Gateway W5100

                                          GertSandersG 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          18

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular