5 Replies Latest reply on May 16, 2019 2:50 AM by GeonaM_26

    Access emulated eeprom from the bootloader

    dan_3972766

      Hi All,

      Running on CY8C4247AZI-M485,

      I have an application (bootable) and a bootloader.

      I followed instruction in "Emulated eeprom v2.0" and got everything running smooth using "checksum excluding sector".

      I can now use emulated eeprom in my bootable application.

       

       

      Now I would like to access the emulated eeprom "checksum excluding sector" from within the bootloader project, - how would I go about it?

       

      thanks

      Dan

        • 1. Re: Access emulated eeprom from the bootloader
          GeonaM_26

          Depending upon the Em_EEPROM v2.x configuration settings ie., size, wear level factor and redundant copy Em_EEPROM component converts the data indices to actual physical address. It is not straight forward to decode the Em_EEPROM physical address from bootloader project.

           

          Instead of Em_EEPROM component, user can us flash read/write API in bootloader and bootloadable projects to update custom data to intended device flash rows. Please refer Flash_Example available in PSoC Creator to get started.

          • 2. Re: Access emulated eeprom from the bootloader
            dan_3972766

            Thanks for your reply -

             

            1. This is a psoc 4 (CY8C4247AZI-M485)  this chip does not have a flash component.

             

            - component was configured as so:

             

             

            2. maybe I need to go about and set the Em_EEPROM in a fixed location by modifying the linker?  is the the correct direction?

             

            thanks

             

            Dan

            • 3. Re: Access emulated eeprom from the bootloader
              GeonaM_26

              User can write custom data to PSoC device flash which contains application code and data. uint32 CySysFlashWriteRow(uint32 rowNum, const uint8 rowData[]) updates flash rowNum with custom rowData. It does not require seperate flash component. However, user needs to ensure that the rownumber is after the application flash area and place in checksum exclude region. For more details, please refer to PSoC 4 system reference guide.

               

              As per the Em_EEPROM configuration window, I assume that the Em_EEPROM is used to store data without wear leveling or redundant copy. You can staright away use flash row write API to store the data at required flash rows. This custom flash row can be read using address pointers in bootloader component. This has been demonstrated in code example: Flash_Example available in PSoC Creator (File > Code Example)

              • 4. Re: Access emulated eeprom from the bootloader
                dan_3972766

                Thanks for your answer.

                 

                I have been able to go by this path by using the Flash_Example you mentioned.

                I did not need to checksum exclude the row i wrote / read too, the example does the job reading / writing from bootloader and application.

                 

                How can I know the amount of rows of application + bootloader use to place my_data in correct location?

                • 5. Re: Access emulated eeprom from the bootloader
                  GeonaM_26

                  Bootloadable validation calculates checksum from the application image start address till the valid end, instead of the device flash end. If the bootloadable application code and data overlaps with the test flash row used to store the custom data, bootloadable application validation might fail. Hence, it is recommended to use Checksum exclude region to place the flash varibale.

                   

                  You can refer to <Project_Name>.map file to understand the placed memory address, size in bytes etc., Hope it helps.