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. Hardware
  3. OTA flash types for MySensors

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.
  • D Dirk_H

    About the AT25F512N wich was proposed by @AWI: tbowmo was right, I got confused by Sector, Page and Block erase. Like tbowmo said atmel does call blocks sectors... The AT25F512 does not support Block Erase 64k, which is defined but AFAIK not used in SPIFlash.cpp BUT it is used in the Bootloader if the "Imagesize" is > 32k. But I dont know how Image size is retrieved. Also I think for an ATMega 328p the image size should never be >32k. So this Flashtype could probably work as long as the image size is below 32k. I'd expect the Bootloader to crash or fail when program size is >32k.

    About the S25FL... @bjacobse proposed I see the problem that it does not support the Bock Erase 32k opcode which is used in SPIFlash.cpp and Bootloader. Both must be changed when S25FL... should be used. (I would emulate the 32k Block erase by 8 times 4k Block erase.) However remember that Dualoptiboot must also be altered which requires "non-arduino" programming and some work / knowlegde about makefiles / compiler/linker settings in IDE.

    bjacobseB Offline
    bjacobseB Offline
    bjacobse
    wrote on last edited by
    #28

    @Dirk_H
    Thank you Dirk for checking the flash I asked about. I have noticed that the company I'm working is using this device. And then I hoped I could buy it from the company to a hopefully reduced price compared to retail price for private.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LastSamurai
      Hardware Contributor
      wrote on last edited by
      #29

      Hey, guys I am currently looking for a (cheap) solution for OTA available in germany. I wanted to use the AT25DF512C-SSHN-B but the only source I could find was aliexpress which only sells 150 pcs at a time (a little too much, although future proof for me I guess ;) ).
      I did not really understand this thread so far: is there another model that works with my sensors?

      Or do you by chance know a place where I can get some of the AT25DF512C-SSHN-B ones here in europe? Thanks!

      jbjallingJ 1 Reply Last reply
      0
      • L LastSamurai

        Hey, guys I am currently looking for a (cheap) solution for OTA available in germany. I wanted to use the AT25DF512C-SSHN-B but the only source I could find was aliexpress which only sells 150 pcs at a time (a little too much, although future proof for me I guess ;) ).
        I did not really understand this thread so far: is there another model that works with my sensors?

        Or do you by chance know a place where I can get some of the AT25DF512C-SSHN-B ones here in europe? Thanks!

        jbjallingJ Offline
        jbjallingJ Offline
        jbjalling
        Hardware Contributor
        wrote on last edited by jbjalling
        #30

        @LastSamurai said:

        AT25DF512C

        Well not in EU, but you can order from DigiKey or Mouser if everything else fails - thats where I order my parts.

        EDIT: And I live in DK - maybe worth mentioning.

        BR Jonas

        L 1 Reply Last reply
        0
        • jbjallingJ jbjalling

          @LastSamurai said:

          AT25DF512C

          Well not in EU, but you can order from DigiKey or Mouser if everything else fails - thats where I order my parts.

          EDIT: And I live in DK - maybe worth mentioning.

          BR Jonas

          L Offline
          L Offline
          LastSamurai
          Hardware Contributor
          wrote on last edited by
          #31

          @LastSamurai said:

          AT25DF512C-SSHN-B

          Thanks, but both have shipping costs of abount 20€ (if you pay <50€ overall). Or is there a way around it?

          I also found SST25VF020B‑80‑4I‑SAE and 25VF512A33-4C-SA flash modules in german stores though. Would they work too?

          jbjallingJ 1 Reply Last reply
          0
          • L LastSamurai

            @LastSamurai said:

            AT25DF512C-SSHN-B

            Thanks, but both have shipping costs of abount 20€ (if you pay <50€ overall). Or is there a way around it?

            I also found SST25VF020B‑80‑4I‑SAE and 25VF512A33-4C-SA flash modules in german stores though. Would they work too?

            jbjallingJ Offline
            jbjallingJ Offline
            jbjalling
            Hardware Contributor
            wrote on last edited by
            #32

            @LastSamurai Yes, thats true. My order is always above the "free shipping" limit :-)
            I'll give the datasheets a look, of the devices you mentioned.

            BR Jonas

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

              @LastSamurai The SST25VF020B... should work fine with the 2.0 developversion and #define MY_SPIFLASH_SST25TYPE set. It seems to be very close to the SST25PF020B I used. However keep an eye on the even more limited voltage range of the SST25VF Type which needs at least 2,7V which would be a problem if you want to power your circuit directly by 2xNiMH Batteries.

              The SST25VF512 needs also 2,7V but additionally does not support the 64k erase command (see my comments on that issue some posts above where I wrote something about the AT25F512).

              1 Reply Last reply
              0
              • X Offline
                X Offline
                XavTroniC
                wrote on last edited by XavTroniC
                #34

                Hi all,

                A question, why don't use an EPPROM SPI 25AA020A or 25AA512?

                They works between 1.8 and 5.5V.

                BR
                Xavier

                S 1 Reply Last reply
                0
                • alexsh1A Offline
                  alexsh1A Offline
                  alexsh1
                  wrote on last edited by alexsh1
                  #35

                  I have AT25512N-SH-T SOIC-8 -> http://www.mouser.com/ds/2/36/Atmel-5165-SEEPROM-AT25512-Datasheet-476711.pdf

                  Anyone knows if it is fully interchangeable with AT25DF512C? I cannot see any difference from the datasheet. The pinout is the same.

                  1 Reply Last reply
                  0
                  • X Offline
                    X Offline
                    XavTroniC
                    wrote on last edited by
                    #36

                    Hi all,

                    Any news with the EEPROM compatibility and the new Mysensors version 2.0?

                    BR,
                    Xavier

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

                      @XavTroniC

                      It's the bootloader that sets the limit on which flash / eeprom you can use, not the library. So the support in 2.0.0 is the same as for 1.5.x

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        mardah
                        Hardware Contributor
                        wrote on last edited by
                        #38

                        Hello,

                        Would AT45DB041E be a good choice as a OTA flash? I see it's in the schematics for the new Sensebender Micro mk2.

                        https://www.adestotech.com/wp-content/uploads/doc8783.pdf

                        BR
                        Martin

                        tbowmoT S 2 Replies Last reply
                        0
                        • M mardah

                          Hello,

                          Would AT45DB041E be a good choice as a OTA flash? I see it's in the schematics for the new Sensebender Micro mk2.

                          https://www.adestotech.com/wp-content/uploads/doc8783.pdf

                          BR
                          Martin

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

                          @mardah

                          I can't remember if I just dumped components in there at the moment, or if I actually looked at the datasheets :)

                          1 Reply Last reply
                          0
                          • X XavTroniC

                            Hi all,

                            A question, why don't use an EPPROM SPI 25AA020A or 25AA512?

                            They works between 1.8 and 5.5V.

                            BR
                            Xavier

                            S Offline
                            S Offline
                            shabba
                            wrote on last edited by
                            #40

                            @XavTroniC said in OTA flash types for MySensors:

                            25AA512

                            Seems these are only 2K in size.
                            I would like something similar though!

                            tbowmoT 1 Reply Last reply
                            0
                            • S shabba

                              @XavTroniC said in OTA flash types for MySensors:

                              25AA512

                              Seems these are only 2K in size.
                              I would like something similar though!

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

                              @shabba

                              It's a 512kbit device, which is 64 kbytes

                              1 Reply Last reply
                              0
                              • M mardah

                                Hello,

                                Would AT45DB041E be a good choice as a OTA flash? I see it's in the schematics for the new Sensebender Micro mk2.

                                https://www.adestotech.com/wp-content/uploads/doc8783.pdf

                                BR
                                Martin

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

                                @mardah said in OTA flash types for MySensors:

                                Would AT45DB041E be a good choice as a OTA flash? I see it's in the schematics for the new Sensebender Micro mk2.

                                Did you ever figure out if this works with Optiboot for OTA flashing?

                                I must admit that i'm very confused at this thread, it was setup to advise of other Flash IC's for us to use but there seems to be no 'solid' alternatives that you guys have suggested. For me, living in the UK, its near impossible to grab any of the AT25DF512C-SSHN-B without paying through the roof for shipping.

                                I can see that AT45DB041E is JEDEC compliant but that is as far as i can go with knowing if it will work. Flash architecture is way out of my depth right now.

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

                                KoreshK 1 Reply Last reply
                                0
                                • S Samuel235

                                  @mardah said in OTA flash types for MySensors:

                                  Would AT45DB041E be a good choice as a OTA flash? I see it's in the schematics for the new Sensebender Micro mk2.

                                  Did you ever figure out if this works with Optiboot for OTA flashing?

                                  I must admit that i'm very confused at this thread, it was setup to advise of other Flash IC's for us to use but there seems to be no 'solid' alternatives that you guys have suggested. For me, living in the UK, its near impossible to grab any of the AT25DF512C-SSHN-B without paying through the roof for shipping.

                                  I can see that AT45DB041E is JEDEC compliant but that is as far as i can go with knowing if it will work. Flash architecture is way out of my depth right now.

                                  KoreshK Offline
                                  KoreshK Offline
                                  Koresh
                                  Contest Winner
                                  wrote on last edited by Koresh
                                  #43

                                  @Samuel235 said in OTA flash types for MySensors:

                                  AT45DB041E

                                  Hello. This chip (AT45DB041E) has no erase 32kb command (0x52), status read command has a strange opcode too (D7h). So it is no trivial task to use this chip.
                                  I can suggest Micron M25P40 as widespread IC. But it requires one trick and I will try to describe it. This chip has no erase 32kb command (0x52) too. It means OTA code will not erase memory and update will be failed. We (me and Yury) bumped into this problem when we started intensive tests of my nodes before production (we use micron M25P40). Moreover, when I try to investigate inexpensive avaliable chips I find an interesting thing. Chips with 64kb erase option (0xD8 opcode) are more common than chips with 32kb erase option (which support 64kb erase option too). So it can be worth adapting mysensors for use of any flash chip which supports 64kb erase option. To adapt your sketches you should do only two things

                                  1. Add this code into your sketch after including mysensors.h
                                  #define SPIFLASH_BLOCKERASE_32K   0xD8
                                  

                                  So OTA library will call erase 64kb command instead of erase 32kb command. It is very easy.
                                  2) You should use Bootloader which calls erase 64kb command instead of 32kb command.
                                  Bad news. It is not an easy task and you should recompile dual optiboot and burn it. :anguished:
                                  Good news. I've recompliled dual optiboot and all my nodes will burn with it by default. :yum:

                                  My changes in bootloader are very simple but it sutable for my boards. We update it many many times and the process is absolutely bulletproof (especially after Tekka's update :+1: ).
                                  But how about a more universal solution? I think it is not too hard to modify dual optiboot to check flash first 10 bytes (OTA flag) after 32kb erase command call and try another command? I will try this idea later but may be someone will do it faster :smiley:

                                  S alexsh1A 2 Replies Last reply
                                  1
                                  • KoreshK Koresh

                                    @Samuel235 said in OTA flash types for MySensors:

                                    AT45DB041E

                                    Hello. This chip (AT45DB041E) has no erase 32kb command (0x52), status read command has a strange opcode too (D7h). So it is no trivial task to use this chip.
                                    I can suggest Micron M25P40 as widespread IC. But it requires one trick and I will try to describe it. This chip has no erase 32kb command (0x52) too. It means OTA code will not erase memory and update will be failed. We (me and Yury) bumped into this problem when we started intensive tests of my nodes before production (we use micron M25P40). Moreover, when I try to investigate inexpensive avaliable chips I find an interesting thing. Chips with 64kb erase option (0xD8 opcode) are more common than chips with 32kb erase option (which support 64kb erase option too). So it can be worth adapting mysensors for use of any flash chip which supports 64kb erase option. To adapt your sketches you should do only two things

                                    1. Add this code into your sketch after including mysensors.h
                                    #define SPIFLASH_BLOCKERASE_32K   0xD8
                                    

                                    So OTA library will call erase 64kb command instead of erase 32kb command. It is very easy.
                                    2) You should use Bootloader which calls erase 64kb command instead of 32kb command.
                                    Bad news. It is not an easy task and you should recompile dual optiboot and burn it. :anguished:
                                    Good news. I've recompliled dual optiboot and all my nodes will burn with it by default. :yum:

                                    My changes in bootloader are very simple but it sutable for my boards. We update it many many times and the process is absolutely bulletproof (especially after Tekka's update :+1: ).
                                    But how about a more universal solution? I think it is not too hard to modify dual optiboot to check flash first 10 bytes (OTA flag) after 32kb erase command call and try another command? I will try this idea later but may be someone will do it faster :smiley:

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

                                    @Koresh - Thank you for explaining this to me. I think i understand this a little more clearly now. Like i said, i've never dealt with flash so its all a grey area for myself.

                                    I'm currently looking at recompiling MYSBootloader for use with an 8Mhz crystal instead of this work around. The whole reasoning behind me asking this question is simply because i wanted OTA updates on a battery powered node. Now, this means i need OTA updates on 3.3v, but my MYSBootloader nodes require 16Mhz crystal to work. So its either use 16Mhz on 3.3v (while it works, its not the correct solution) OR to get a bootloader working with an 8Mhz crystal setup. I chose the later, and therefor its either recompile MYSBootloader to work with 8Mhz OR to get a flash IC on the board to allow for Dual Optiboot.

                                    At the moment i'm toying with the idea of going the software issue route and attempting to recompile MYSBootloader for 8Mhz (just need to workout what to change for the recompiled version). Seems a little easier and cheaper than going the route of flash considering my location and not being able to get my hands on the recommended/mostly used flash IC.

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

                                    1 Reply Last reply
                                    0
                                    • KoreshK Koresh

                                      @Samuel235 said in OTA flash types for MySensors:

                                      AT45DB041E

                                      Hello. This chip (AT45DB041E) has no erase 32kb command (0x52), status read command has a strange opcode too (D7h). So it is no trivial task to use this chip.
                                      I can suggest Micron M25P40 as widespread IC. But it requires one trick and I will try to describe it. This chip has no erase 32kb command (0x52) too. It means OTA code will not erase memory and update will be failed. We (me and Yury) bumped into this problem when we started intensive tests of my nodes before production (we use micron M25P40). Moreover, when I try to investigate inexpensive avaliable chips I find an interesting thing. Chips with 64kb erase option (0xD8 opcode) are more common than chips with 32kb erase option (which support 64kb erase option too). So it can be worth adapting mysensors for use of any flash chip which supports 64kb erase option. To adapt your sketches you should do only two things

                                      1. Add this code into your sketch after including mysensors.h
                                      #define SPIFLASH_BLOCKERASE_32K   0xD8
                                      

                                      So OTA library will call erase 64kb command instead of erase 32kb command. It is very easy.
                                      2) You should use Bootloader which calls erase 64kb command instead of 32kb command.
                                      Bad news. It is not an easy task and you should recompile dual optiboot and burn it. :anguished:
                                      Good news. I've recompliled dual optiboot and all my nodes will burn with it by default. :yum:

                                      My changes in bootloader are very simple but it sutable for my boards. We update it many many times and the process is absolutely bulletproof (especially after Tekka's update :+1: ).
                                      But how about a more universal solution? I think it is not too hard to modify dual optiboot to check flash first 10 bytes (OTA flag) after 32kb erase command call and try another command? I will try this idea later but may be someone will do it faster :smiley:

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

                                      @Koresh what about Winbond W25X40CLSNIG - the same used by Moteino? It seems to me this could be a good match?

                                      https://www.winbond.com/resource-files/w25x40cl_e01.pdf

                                      @tbowmo Thomas, what do you think?

                                      KoreshK 1 Reply Last reply
                                      0
                                      • alexsh1A alexsh1

                                        @Koresh what about Winbond W25X40CLSNIG - the same used by Moteino? It seems to me this could be a good match?

                                        https://www.winbond.com/resource-files/w25x40cl_e01.pdf

                                        @tbowmo Thomas, what do you think?

                                        KoreshK Offline
                                        KoreshK Offline
                                        Koresh
                                        Contest Winner
                                        wrote on last edited by Koresh
                                        #46

                                        @alexsh1 It seems suitable at first sight :wink:

                                        alexsh1A 1 Reply Last reply
                                        0
                                        • KoreshK Koresh

                                          @alexsh1 It seems suitable at first sight :wink:

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

                                          @Koresh I have just tried it and it works nicely.

                                          Start...Init OK!
                                          DeviceID: EF30
                                          Flash content:
                                          FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.
                                          
                                          WriteByte(1)
                                          WriteByte(2)
                                          WriteByte(3)
                                          WriteByte(4)
                                          WriteByte(5)Flash content:
                                          FF.BB.BB.BB.AA.BB.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.
                                          Erasing Flash chip ... DONE
                                          

                                          The only disadvantage to me is voltage given that nrf24l01+ can run down to 1.9V

                                          Features

                                          • 2.3V to 3.6V supply
                                          • 1mA active current,
                                          • <1μA Power-down

                                          Aliexpress: $0.25 a piece + postage ($2.50 to Europe)

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


                                          17

                                          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