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. General Discussion
  3. Absolute location of system config in EEProm

Absolute location of system config in EEProm

Scheduled Pinned Locked Moved General Discussion
9 Posts 3 Posters 54 Views 3 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.
  • M Offline
    M Offline
    mariusl
    wrote on last edited by
    #1

    Hi
    I want to store some custom config variables in EEprom prior to the hardware init of the system.
    The question is where is the system config located in the EEprom and where can I go write without doing damage?

    1 Reply Last reply
    0
    • electrikE Offline
      electrikE Offline
      electrik
      wrote on last edited by
      #2

      If you use saveState() and loadState() the library will handle this for you

      https://www.mysensors.org/download/sensor_api_20

      M 1 Reply Last reply
      1
      • mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by mfalkvidd
        #3

        In addition to saveState, there are also low-level functions to read/write larger blocks: https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/hal/architecture/MyHwHAL.h#L66

        But if you use the low level functions, you'll need to calculate position yourself. You can use EEPROM_LOCAL_CONFIG_ADDRESS as start address.

        M 1 Reply Last reply
        0
        • electrikE electrik

          If you use saveState() and loadState() the library will handle this for you

          https://www.mysensors.org/download/sensor_api_20

          M Offline
          M Offline
          mariusl
          wrote on last edited by
          #4

          @electrik said in Absolute location of system config in EEProm:

          If you use saveState() and loadState() the library will handle this for you

          https://www.mysensors.org/download/sensor_api_20

          Will this be true for a situation before the mySensors library has been initialized? I want to save my data before the system is loaded.

          1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            In addition to saveState, there are also low-level functions to read/write larger blocks: https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/hal/architecture/MyHwHAL.h#L66

            But if you use the low level functions, you'll need to calculate position yourself. You can use EEPROM_LOCAL_CONFIG_ADDRESS as start address.

            M Offline
            M Offline
            mariusl
            wrote on last edited by
            #5

            @mfalkvidd said in Absolute location of system config in EEProm:

            You can use EEPROM_LOCAL_CONFIG_ADDRESS as start address.

            I take it this will be allocated after the system config block? Does this include the locations for saveState()? I noticed that you can give an address for the saveState() to locate the data. If that is not included in the system config block it will make sense to just add a couple of bytes to the EEPROM_LOCAL_CONFIG_ADDRESS and make sure that the saveState() locations are below that.

            mfalkviddM 1 Reply Last reply
            0
            • M mariusl

              @mfalkvidd said in Absolute location of system config in EEProm:

              You can use EEPROM_LOCAL_CONFIG_ADDRESS as start address.

              I take it this will be allocated after the system config block? Does this include the locations for saveState()? I noticed that you can give an address for the saveState() to locate the data. If that is not included in the system config block it will make sense to just add a couple of bytes to the EEPROM_LOCAL_CONFIG_ADDRESS and make sure that the saveState() locations are below that.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by mfalkvidd
              #6

              @mariusl I am not sure I understand the question, but saveState will add EEPROM_LOCAL_CONFIG_ADDRESS to the position you use in the call.

              See https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MySensorsCore.cpp#L546

              M 1 Reply Last reply
              0
              • mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by
                #7

                https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MyEepromAddresses.h might be useful

                M 1 Reply Last reply
                0
                • mfalkviddM mfalkvidd

                  @mariusl I am not sure I understand the question, but saveState will add EEPROM_LOCAL_CONFIG_ADDRESS to the position you use in the call.

                  See https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MySensorsCore.cpp#L546

                  M Offline
                  M Offline
                  mariusl
                  wrote on last edited by
                  #8

                  @mfalkvidd said in Absolute location of system config in EEProm:

                  @mariusl I am not sure I understand the question, but saveState will add EEPROM_LOCAL_CONFIG_ADDRESS to the position you use in the call.

                  See https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MySensorsCore.cpp#L546

                  That is what I asked thanks.

                  1 Reply Last reply
                  0
                  • mfalkviddM mfalkvidd

                    https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MyEepromAddresses.h might be useful

                    M Offline
                    M Offline
                    mariusl
                    wrote on last edited by
                    #9

                    @mfalkvidd said in Absolute location of system config in EEProm:

                    https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MyEepromAddresses.h might be useful

                    Wow thanks. That is exactly what I needed.
                    Thanks for the help, you are a champion.

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


                    20

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 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