4 Replies Latest reply on Feb 8, 2019 4:24 AM by VlKh_2251656

    FX3 SRAM Write example

    VlKh_2251656

      Hello.

       

      Now I am looking at an example for a CYUSB3KIT-003 kit.

      The example is called SRAM.

      "3.6.2 SRAM Example"

       

      In source code there is example of reading from memory(file "cyfxsram.c").

       

      CyU3PDebugPrint(4,"Read\n\r");
      
      apiRetStatus = CyU3PGpifSMSwitch (256, START1, 256, 0, 0);
      if(apiRetStatus != CY_U3P_SUCCESS)
      {
           CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PGpifSMSwitch failed, Error code = %d\r\n", apiRetStatus);
      }
      CyU3PUsbAckSetup ();
      isHandled = CyTrue;
      

       

      But there is no example of writing to memory.

      Tell me, is it so?

      How can I write to memory?

        • 1. Re: FX3 SRAM Write example
          SrinathS_16

          Hello,

           

          I hope you are referring to the SRAMMaster example firmware that comes with the FX3 SDK. If not, please mention the one that you are using.

           

          The state machine that is used in this example is by default in the WRITE part. So, any data that is sent on the Bulk OUT endpoint is transferred to the SRAM. In order to perform READ, the state machine must be switched to the READ part. This is done through the vendor command in the firmware.

           

          WRITEs to SRAM do not require any additional vendor commands.

           

          Best regards,
          Srinath S

          1 of 1 people found this helpful
          • 2. Re: FX3 SRAM Write example
            VlKh_2251656

            Yes of course.

            That example, which comes in the package.

            Thank you very much.

             

            Is it possible to write data to memory not by transferring it from a computer, but from the microcontroller itself?

            For example, does the microcontroller calculate some data and write it to the SRAM itself?

             

            Tell me please, one more question is available.

            In the kit is used chip CY7C1062DV33.

            Is the entire size of its memory available (8 mbytes)?

            • 3. Re: FX3 SRAM Write example
              abhinavg_21

              Hi,

               

              -- Is it possible to write data to memory not by transferring it from a computer, but from the microcontroller itself?

              Yes it is possible. Whenever you want to write to SRAM you have to invoke the GPIF SM with WRITE state.

               

              --Is the entire size of its memory available (8 mbytes)?

               

              It depends upon  the counter values set in the GPIF designer tool.

               

              Thanks & Regards

              Abhinav

              • 4. Re: FX3 SRAM Write example
                VlKh_2251656

                Many thanks!