4 Replies Latest reply on Feb 1, 2018 2:43 AM by prbd

    understanding base address and offset

    binodaryal

      hello,

       

      I have trouble understanding the idea of base address and offset in NOR flash? If you can help me understand the idea behind bank, base address and offset that will be great. I am trying to read and write on flash based on ARM processor and mbed. If you can provide me an example code in c or c++ to read and write on the nor-flash I would more than appreciate it?

       

      I am more of myself from software background and recently started developing embedded project.

        • 1. Re: understanding base address and offset
          prbd

          Hi Binod,

           

          I am providing the link below for the low level drivers for NOR flash. Kindly go through them. You will find example C code for write and read operation. Let us know if you face any issues or have any further queries.

           

          Low Level Driver for NAND Flash | Cypress Semiconductor

           

           

          Thanks,

          Pradipta.

          • 2. Re: understanding base address and offset
            binodaryal

            Hello,

             

            Thank you for the reply. I am not able to run the download link you have provided for some reason. And I am using NOR flash (S29GL128P90FFIR1) rather than NAND I have copy pasted the code below.

                 

                 x =0;
                 len = 4;
                 buff[0]=1;
                 buff[1]=2;
                 buff[2]=2;
                 buff[3]=3;

             

                  offset = 1;

                  nor->erase_page(offset);
                   nor->write( offset, buff, len );
                  read = lld_ReadOp(BA,offset);
                  sprintf(temp,"%d",read);

                  GUI_SetBkColor(GUI_BLUE);
                  GUI_DispStringAt(temp,300,60);

               

            When I run this code which is i am trying to write 1234 to flash and read for testing, I am getting 8193 when I read it.

             

            And does the value I write to flash has to be unsigned short or I can write strings to the flash?

             

            Any example code would be a great help, since I have alredy got the cypress LLD reference pdf.

             

            Thank you in advance!

            • 3. Re: understanding base address and offset
              binodaryal

              Hello,

              I am still struggling with the nor flash device. Can you please provide me the cypress ffs and block driver?

              • 4. Re: understanding base address and offset
                prbd

                Hi Binod,

                 

                Kindly create a tech support case with us for Cypress FFS registration process.

                 

                Thanks and Regards,

                Pradipta.