Write Buffer Program implementation

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

im trying to implement the Write Buffer Program  on S29GL064S70BHI040 and its not working and i dont know why.

this is the code:

       0x105555 = 0x00AA; // enter Write To Buffer program mode  - First Cycles
       0x102AAA = 0x0055; //- Second Cycles
        0x2B8000 = 0x0025; // - Third Cycles

        0x2B8000 = (WC-1); //number of word minus 1 - Fourth Cycles
       0x2B8000 = PD[0]; //  Fifth Cycles

        for(i =1; i < dataLength;++i)//the -1 is because the Fifth Cycles
        {

            0x2B8000 = DA; // 0x2B8000 start addres +i evry Cycles
            StartAddr++;
        }

        0x2B8000 = 0x029; // init Buffer to Flash

     

s16_timer = Cntr_125;
           do {
              oldData = newData;
              for (i = 0; i < 20; i++)
                 newData = i; // delay...
              newData = *data;
              } while( ((oldData != newData) || (newData != *data)) && (PassedTime(TEN_MSEC_ON_125, s16_timer) == 0) );
           // Bit2 6 or 2 are toggled while Word Program is in progress, or written Data is not correct.


           if ((Last Write Adder) == PD)
           {
               ans = FLASH_STATUS_SUCCESS;
           }
           else
           {
               ans = STATUS_FLASH_FAIL;;
           }

Please Help me to understand  Why.

thenks

0 Likes
1 Solution

Hello,

Please refer to the LLD which can be downloaded from the link below: http://www.cypress.com/documentation/software-and-drivers/low-level-driver-nor-flash

There is a lot of basic coding errors in the code, so here are some comments:

  • You should define a variable for your base address and make it volatile.
  • Unlock address 1 and 2 are 0x555and 0x2AA and not 0x5555 and 0x2AAA.
  • The flash is used in word mode so the byte address using word offset 0x555 will result in 0xAAA
  • Writing the data to be programmed should be done to the offset where it will be programmed to. Now it is all written to 0x2B8000
  • What does this mean: 0x105555 = 0x00AA;”. Is this C code???

Please use  Cypress LLD.

Thank you

Regards,

Bushra

View solution in original post

0 Likes
2 Replies
BushraH_91
Moderator
Moderator
Moderator
750 replies posted 50 likes received 250 solutions authored

Hello,

Thank you for contacting Cypress First Community Forum. Currently we are reviewing the issue and get back to you as soon as we find the resolution.

Have a wonderful day

Regards,

Bushra

0 Likes

Hello,

Please refer to the LLD which can be downloaded from the link below: http://www.cypress.com/documentation/software-and-drivers/low-level-driver-nor-flash

There is a lot of basic coding errors in the code, so here are some comments:

  • You should define a variable for your base address and make it volatile.
  • Unlock address 1 and 2 are 0x555and 0x2AA and not 0x5555 and 0x2AAA.
  • The flash is used in word mode so the byte address using word offset 0x555 will result in 0xAAA
  • Writing the data to be programmed should be done to the offset where it will be programmed to. Now it is all written to 0x2B8000
  • What does this mean: 0x105555 = 0x00AA;”. Is this C code???

Please use  Cypress LLD.

Thank you

Regards,

Bushra

0 Likes