Skip to content
  • 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. Hardware
  3. OTA flash types for MySensors
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

OTA flash types for MySensors

Scheduled Pinned Locked Moved Hardware
64 Posts 23 Posters 24.6k Views 20 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.
  • GertSandersG Offline
    GertSandersG Offline
    GertSanders
    Hardware Contributor
    wrote on last edited by GertSanders
    #1

    I thought it would be useful to compile a list of flash memory compatible with DualOptiboot and other OTA capable bootloaders.

    So the plan is to pin this message and add SPI based Flashmemory typenumbers/brands and how they are connected to the relevant OTA bootloader.

    I know most bootloaders require SPI based flash memory. I have found 1 article describing a bootloader which allows the use of I2C EEPROM (http://www.rotwang.co.uk/projects/bootloader.html). But this is outside scope of MySensors for the moment.

    So for following OTA' BL's:

    DualOptiboot:

    Allows a maximum sketch size of 64Kbytes. People with atmega1284p and 130KByte sketches are out of luck.
    From the designnotes of DualOptiboot:

    Limited to 31K sketches for atmega328p and 64K sketches for atmega1284P
    
    

    DualOptiboot is based on Optiboot 5.0

    Brand, modelnumber, connectiontype, capacity, voltage-range

    Adesto Technologies, AT25DF512C-SSHN-B, SPI, 65Kbyte (512Kbit), VCC = 1.65V - 3.6V
    Bondwell, partnumber_unknown, SPI, 64KBytes
    etc ....

    MYSBootloader:
    ...

    As you answer I will add this info to this first message.

    Maybe more details need to be compiled if they are necessary for compatibility with the bootloaders specified. Feel free to comment on this as well

    1 Reply Last reply
    4
    • ahmedadelhosniA Offline
      ahmedadelhosniA Offline
      ahmedadelhosni
      wrote on last edited by
      #2

      Good topic as I actually can't find documents related to OTA.

      I want to flash dualoptiboot bootloader as I am using an eeprom but which application do I use to flash my nodes ?

      1 Reply Last reply
      0
      • scalzS Offline
        scalzS Offline
        scalz
        Hardware Contributor
        wrote on last edited by scalz
        #3

        @ahmedadelhosni You need to flash your atmels with an usbasp and dualoptiboot or sensebender bootloader but I think you already know it ;) . Then to OTA your nodes you can use MYSXController, or maybe there are some controllers able to handle this too, I don't know as I use mysxcontroller for this.
        If it can help, I made this howto for french jeedom user, when 1.5 was released (almost complete, I think things have not changed too much; I have not done ota since some time..):
        https://www.jeedom.com/forum/viewtopic.php?f=35&t=9539
        It's in french, but there are some pics.. (I should have already translated it but no time for the moment, so if you want to do it, I may help)

        1 Reply Last reply
        0
        • tbowmoT Offline
          tbowmoT Offline
          tbowmo
          Admin
          wrote on last edited by
          #4

          @GertSanders .

          In theory there is nothing holding back on using a 4 or 8Mbit SPI flash. DualOptiboot ony supports reading the first 64Kbytes.. The rest could in theory be used to store sensor data, display data (in case you have a graphical display, and have some pictures to show).

          And by the way, EEPROM is not FLASH, it's two different storrage technologies. Eeprom, you can rewrite a single byte/cell, while flash you need to erase a whole page (Multiple bytes / cells) before rewriting data to it. Also eeprom's can usually sustain a much higher re-programming rate than flash

          GertSandersG 1 Reply Last reply
          1
          • scalzS Offline
            scalzS Offline
            scalz
            Hardware Contributor
            wrote on last edited by scalz
            #5

            @tbowmo I thought same things...
            @ahmedadelhosni : translation roughly done ;) Here http://forum.mysensors.org/topic/3503/sensebender-dualoptiboot-ota-howto-in-mysensors

            ahmedadelhosniA P 2 Replies Last reply
            0
            • ahmedadelhosniA Offline
              ahmedadelhosniA Offline
              ahmedadelhosni
              wrote on last edited by
              #6

              Thanks guys for the help.

              So in conclusion, any OTA application shall work. The bootloader is responsible for flashing. Whether to copy my code to flash then after that copy to my atmega if I am using DualOptiboot or just use MyScontroller which as far as I remember does not copy to extenal flash.

              Am I write ?

              tbowmoT 1 Reply Last reply
              0
              • scalzS scalz

                @tbowmo I thought same things...
                @ahmedadelhosni : translation roughly done ;) Here http://forum.mysensors.org/topic/3503/sensebender-dualoptiboot-ota-howto-in-mysensors

                ahmedadelhosniA Offline
                ahmedadelhosniA Offline
                ahmedadelhosni
                wrote on last edited by
                #7

                I read @scalz new post. It answers my above questions.

                Thanks everyone for the help.

                1 Reply Last reply
                0
                • ahmedadelhosniA ahmedadelhosni

                  Thanks guys for the help.

                  So in conclusion, any OTA application shall work. The bootloader is responsible for flashing. Whether to copy my code to flash then after that copy to my atmega if I am using DualOptiboot or just use MyScontroller which as far as I remember does not copy to extenal flash.

                  Am I write ?

                  tbowmoT Offline
                  tbowmoT Offline
                  tbowmo
                  Admin
                  wrote on last edited by
                  #8

                  @ahmedadelhosni said:

                  Thanks guys for the help.

                  So in conclusion, any OTA application shall work. The bootloader is responsible for flashing. Whether to copy my code to flash then after that copy to my atmega if I am using DualOptiboot or just use MyScontroller which as far as I remember does not copy to extenal flash.

                  Am I write ?

                  For dualoptiboot, you need to compile the library with Ota support (and have an external flash connected). The advantage here is that it's radio agnostic. Mysbootloader is only usable with nrf24 radio.

                  Controller shouldn't care about which bootloader you have. The library uses same Ota transport mechanism as mysbootloader does, when used together with Dualoptiboot and external flash.

                  1 Reply Last reply
                  1
                  • tbowmoT tbowmo

                    @GertSanders .

                    In theory there is nothing holding back on using a 4 or 8Mbit SPI flash. DualOptiboot ony supports reading the first 64Kbytes.. The rest could in theory be used to store sensor data, display data (in case you have a graphical display, and have some pictures to show).

                    And by the way, EEPROM is not FLASH, it's two different storrage technologies. Eeprom, you can rewrite a single byte/cell, while flash you need to erase a whole page (Multiple bytes / cells) before rewriting data to it. Also eeprom's can usually sustain a much higher re-programming rate than flash

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

                    @tbowmo

                    Good to know, I was not clear on the difference between flash and eeprom

                    1 Reply Last reply
                    0
                    • ahmedadelhosniA Offline
                      ahmedadelhosniA Offline
                      ahmedadelhosni
                      wrote on last edited by
                      #10

                      Summary: MYSContoller is used for OTA updates regarding the bootloader used. The bootloader is responsible to handle the packets sent by copying it to an external EEPROM and then doing a reset, this is DualOptiboot. The other scenario is using MYSBootloader where the bootloader resets the Atmega and the bootloader handles the received packets with the new firmware.

                      Correct me please if I am mistaken.

                      1 Reply Last reply
                      0
                      • ahmedadelhosniA Offline
                        ahmedadelhosniA Offline
                        ahmedadelhosni
                        wrote on last edited by
                        #11

                        The other topic which I guess is important to be included here is using Signing with OTA.
                        Do both bootloaders support Signing during flashing ? The answer is in the below link.

                        http://forum.mysensors.org/topic/2997/signing-or-encrypting-the-data/27

                        This discussion worth to be read. Originally it talks about signing vs encryption but I have asked the question regarding Signing in bootloader and that was the answer of Anticimex

                        NB: tekka has released MYSBootloader 1.3pre (1.3NS) and it states also that upcoming release (1.3S) will have Signing support. Link to topic

                        GertSandersG 1 Reply Last reply
                        0
                        • ahmedadelhosniA ahmedadelhosni

                          The other topic which I guess is important to be included here is using Signing with OTA.
                          Do both bootloaders support Signing during flashing ? The answer is in the below link.

                          http://forum.mysensors.org/topic/2997/signing-or-encrypting-the-data/27

                          This discussion worth to be read. Originally it talks about signing vs encryption but I have asked the question regarding Signing in bootloader and that was the answer of Anticimex

                          NB: tekka has released MYSBootloader 1.3pre (1.3NS) and it states also that upcoming release (1.3S) will have Signing support. Link to topic

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

                          @ahmedadelhosni

                          I would like to keep this discussion on the Hardware topic: which flash memory can be used for OTA ?

                          All other - relevant no doubt - questions you raise deserve a separate discussion in the Development topic. They are not hardware related.

                          ahmedadelhosniA 1 Reply Last reply
                          0
                          • GertSandersG GertSanders

                            @ahmedadelhosni

                            I would like to keep this discussion on the Hardware topic: which flash memory can be used for OTA ?

                            All other - relevant no doubt - questions you raise deserve a separate discussion in the Development topic. They are not hardware related.

                            ahmedadelhosniA Offline
                            ahmedadelhosniA Offline
                            ahmedadelhosni
                            wrote on last edited by
                            #13

                            @GertSanders Yeah write :) Just forgot the title of the topic during our discussions :)

                            1 Reply Last reply
                            0
                            • GulpmanG Offline
                              GulpmanG Offline
                              Gulpman
                              wrote on last edited by
                              #14

                              I do not have a list of working flash types but did a search for them. See below a list of what I found and think could fit. I also added where the specifications differ from the AT25DF512C. As I do not know exactly what is important from the specs I would appreciate it if someone with more knowledge on the topic could help to differentiate about what's important and what's not.
                              At least if one of the chips is not usable we can add them here, too - in a negative list. So we have information on those working and those who are not working in one place.

                              That's what I found:

                              SST25VF512A -> Datasheet: http://www.mouser.com/ds/2/268/25090A-708983.pdf

                              • operating voltage only 2.7 - 3.6V
                              • no Dual Output Read?
                              • 33 MHz max. frequency
                              • Couldn't find anything about JEDEC Standard Manufacturer and Device ID Read Methodology

                              SST25WF512A -> Datasheet: http://www.mouser.com/ds/2/268/20005016C-709021.pdf

                              • operating voltage only 1.65 - 2.9V
                              • no Dual Output Read?
                              • 40 MHz max. frequency
                              • Couldn't find anything about JEDEC Standard Manufacturer and Device ID Read Methodology

                              ISSI IS25CD512 -> Datasheet: http://www.mouser.com/ds/2/198/25CD512-010-LD020-258252.pdf

                              • operating voltage only 2.7 - 3.6V
                              • 100 MHz max. frequency
                              • supports JEDEC Standard Manufacturer and Device ID Read Methodology

                              W25X05-SN -> Datasheet: http://www.winbond.co.jp/resource-files/w25x05cl_e01.pdf

                              • operating voltage only 2.3 - 3.6V
                              • 104 MHz max. frequency
                              • supports JEDEC Standard Manufacturer and Device ID Read Methodology

                              Disadvantage of all of the above is that they seem to need far more than 2.0V to operate (bad for a battery sensor).

                              I think the AT25DF512C is best for the job but unfortunately I couldn't find a distributor in Europe. Digikey and Mouser (only places I know where to get it) do bill you $20 for shipping to Europe which I would like to avoid. :)

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                Dirk_H
                                Contest Winner
                                wrote on last edited by Dirk_H
                                #15

                                @Gulpman @hek
                                Hello everybody,
                                I just added a pullrequest which will support SST25 Series flash for OTA Bootloader:
                                https://github.com/mysensors/Arduino/pull/445

                                SST25 Series flash mentioned by Gulpman as 1st and 2nd Alternative are currently not supported, because the dont support pagewriting with opcode 0x02. Instead they support Automatic Address Increment Word writing (opcode 0xAD). I updated teh SPIFlash.cpp and .h so they will take care of that if #define MY_SPIFLASH_SST25TYPE is set somewhere.
                                I tested with this SPI Flash: http://www.reichelt.de/25PF020B80-4C-S/3/index.html?&ACTION=3&LA=446&ARTICLE=137365&artnr=25PF020B80-4C-S&SEARCH=25pf020b80 which is of Type SST25PF020B-80-4C-SAE (2MBit) and working now.

                                I only hat a short look at the ISSI and Winbond flash Datasheets mentioned by Gulpman before. At first look I think they both could work with the current Mysensors / SPIFlash Version becuase they support Pagewriting with opcode 0x02 and seem to implement the other relevant opcodes. However I did not test..!

                                Best Regards
                                DirkH / D-H-R :)

                                -edited on 2016-06-01 to take care of changed Name for define (added "MY_")

                                1 Reply Last reply
                                2
                                • tbowmoT Offline
                                  tbowmoT Offline
                                  tbowmo
                                  Admin
                                  wrote on last edited by
                                  #16

                                  @Dirk_H

                                  Did you test the SST25 together with DualOptiboot? Or is it only the writing from library that is tested?

                                  1 Reply Last reply
                                  0
                                  • D Offline
                                    D Offline
                                    Dirk_H
                                    Contest Winner
                                    wrote on last edited by
                                    #17

                                    @tbowmo
                                    I tested the complete chain with SST25. I.e. I prepared two sketches and uploaded them via OTA with MYSController and checked that the sketch changed via presentation Message.

                                    Dual Optiboot does not need modification because AFAIK it only reads from Flash, which works the same way for SST and other Flash Types.

                                    1 Reply Last reply
                                    0
                                    • KoreshK Offline
                                      KoreshK Offline
                                      Koresh
                                      Contest Winner
                                      wrote on last edited by Koresh
                                      #18

                                      I am new in this thread. But I think it may be worth using spi jedec flash in my latest hardware projects (insertable socket and insertable switch). So it will key to the future :)
                                      What about atmel AT26DF series(4/8mb)? It's compartible with AT25DF series pin to pin.

                                      1 Reply Last reply
                                      0
                                      • tbowmoT Offline
                                        tbowmoT Offline
                                        tbowmo
                                        Admin
                                        wrote on last edited by
                                        #19

                                        @Dirk_H

                                        I think that DualOptiboot is writing to the external flash, after a successful upgrade of the internal flash, as it tries to delete the image stored there.

                                        But I haven't looked that much into the design of dualoptiboot.. Just forked it, and adjusted bits here and there, to be suitable for the sensebender :) So I don't know what commands it uses to erase the data.

                                        1 Reply Last reply
                                        0
                                        • D Offline
                                          D Offline
                                          Dirk_H
                                          Contest Winner
                                          wrote on last edited by Dirk_H
                                          #20

                                          @tbowmo
                                          I looked at the defines inside the DualOptibootloader, I truly hope that there is no "hardcoded" opcode hidden somewhere... Assuming this, dualoptiboot does not write to the SPIFlash. It does erase, however thats not writing in this scope ;)

                                          #define SPIFLASH_STATUSWRITE      0x01        // write status register
                                          #define SPIFLASH_STATUSREAD       0x05        // read status register
                                          #define SPIFLASH_WRITEENABLE      0x06        // write enable
                                          #define SPIFLASH_ARRAYREADLOWFREQ 0x03        // read array (low frequency)
                                          #define SPIFLASH_BLOCKERASE_32K   0x52        // erase one 32K block of flash memory
                                          #define SPIFLASH_BLOCKERASE_64K   0xD8        // erase one 32K block of flash memory
                                          #define SPIFLASH_JEDECID          0x9F        // read JEDEC ID
                                          

                                          @Koresh please post a link to the datasheet. You can also check on your own: check if your spi-flash supports all commands listed in the SPIFlash.h defines. Of cause obvious things such as pinning and supply voltage range must also be checked.

                                          A caveeat I fell into, was that opcode 0x02 supports byte and pageprogramming for some SPI-Flash types but not for all (e.g. SST25 does not support pageprogramming but therefore has the AAI Wordprogramming feature).

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


                                          21

                                          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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular