6 Replies Latest reply on Feb 5, 2020 6:48 AM by GaSh_293351

    EEPROM programming

    GaSh_293351

      I want to load data to the EEPROM of CY8c5868.

      As I understand, it can be done with PSoC programmer.

      s there an information how it is done, and the format of the file?

        • 1. Re: EEPROM programming
          LePo_1062026

          GaSh,

           

          In the PSoC5 there is a "EEPROM" tab in the DWR (Design Wide Resources). When you select the "Include EEPROM in Hex file" the EEPROM map shown below will be pushed into the EEPROM during programming time.  Therefore with the map below, you can preload values in the EEPROM image at programming-time.  During run-time, these value can be altered by the Application.

          Is this what you are looking for?

           

          Len

          1 of 1 people found this helpful
          • 2. Re: EEPROM programming
            GaSh_293351

            LePo_106202,

            Thank you.

            According to this solution the initial data is defined before the compilation.

            My customer wants to updata the data (e.g. serial number) before programming.

            Is there a way to do it, without opening the source code, updating, compiling, and generating Hex file for each device?

            Gal

            • 3. Re: EEPROM programming
              BiBi_1928986

              Hello GaSh.

               

              To answer your first question, the format of the file is Intel Hex format.  You'll find a description in Appendix A:

              https://www.cypress.com/documentation/programming-specifications/psoc-5lp-device-programming-specification

              https://www.cypress.com/file/119651/download

               

              To write to EEPROM without re-compiling, there are several options.

              1) Write a PERL/TCL/Python/etc script to modify the hex file that Creator generates.

              2) Use a hex editor to enter the EEPROM values and save as Intel hex to a new file.  Edit the Creator generated hex file and paste the new hex file generated from hex editor (at appropriate location of course).

              3) Create a set of COM scripts to control Miniprog3 (or Kitprog).  There are example scripts in the PSoC Programmer folder.

                  C:\Program Files\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\C_Sharp_EEPROM

                 Reference also Psoc Programmer CLI manual:

                 https://www.cypress.com/file/136431/download

              4) Look at the scripts in 5LP Programming Spec for EEPROM programming, chapter 5.12.  The low level commands are further described in 5LP Architecture TRM  manual, chapter 41.  https://www.cypress.com/file/123561/download

              5) Could set up an i2C bridge with target 5LP and Miniprog3.  Use MiniProg3 to send commands to target to write to EEPROM.  This requires a bit of an app on target to interpret/execute the i2C commands.

              6) Many-many other ways to do this.

               

              The method Len mentioned works perfectly well.  But yes, you have to recompile.

               

              Depending on how many 5LP's will be programmed per day, will dictate how much effort goes into automating the EEPROM write process.

               

              Good luck with your project.

              1 of 1 people found this helpful
              • 4. Re: EEPROM programming
                LePo_1062026

                GaSh,

                 

                Did you know that Cypress provides a unique 64bit Silicon ID with each PSoC?  If this can be used as a Serial number for your customer the code is very easy and doesn't require any EEPROM. uid = unique ID.  I use this uid for my projects.  It helps me identify which PCBA it is.  Additionally Cypress uses the uid to identify which COM port number gets assigned when you plug into the USB port.

                 

                Code:

                uint64_t uid;
                    CyGetUniqueId((uint32 *)&uid);
                

                 

                If your customer wants its own Serial number, there are ways to load the new Serial Number after programming and then look it down for preventing further modifications.  It requires that the PSoC use some communication protocol (such as UART) with a hidden command to store a Serial number in EEPROM and then a command to lock it once written.

                 

                Len

                1 of 1 people found this helpful
                • 5. Re: EEPROM programming
                  GaSh_293351

                  Thank you.

                  It is very helpfull.

                  Gal

                  • 6. Re: EEPROM programming
                    GaSh_293351

                    Thank you.

                    We cannot use the Silicone ID.

                    Because of operational issues, we considering loading the number via UART, or in programming.

                    Gal