2 Replies Latest reply on Jan 7, 2020 10:47 PM by ApurvaS_36

    how to s29gl512T buffer programming

    lixu_4619546

      Hello :

           now my mcu is  stm32f407 use s29gl512T as external storage, and reference datasheet

       

      my code is

       

      NOR_Status FSMC_NOR_ProgramBuffer(uint16_t* pBuffer, uint32_t WriteAddr, uint32_t NumHalfwordToWrite)

       

      {

       

      uint32_t lastloadedaddress = 0x00;

      uint32_t currentaddress = 0x00;

      uint32_t endaddress = 0x00;

       

       

      /* Initialize variables */

      currentaddress = WriteAddr;

      endaddress = WriteAddr + NumHalfwordToWrite - 1;

      lastloadedaddress = WriteAddr;

       

      /* Issue unlock command sequence */

      NOR_WRITE(ADDR_SHIFT(0x00555), 0x00AA);

      NOR_WRITE(ADDR_SHIFT(0x02AA), 0x0055);

      /* Write Write Buffer Load Command */

      NOR_WRITE(ADDR_SHIFT(WriteAddr), 0x0025);

      NOR_WRITE(ADDR_SHIFT(WriteAddr), (NumHalfwordToWrite - 1));

       

       

      /* Load Data into NOR Buffer */

      while(currentaddress <= endaddress)

      {

      /* Store last loaded address & data value (for polling) */

      lastloadedaddress = currentaddress;

      NOR_WRITE(ADDR_SHIFT(currentaddress), *pBuffer++);

      currentaddress += 2;

       

      }

       

      NOR_WRITE(ADDR_SHIFT(lastloadedaddress), 0x29);

      return(FSMC_NOR_GetStatus(Program_Timeout));

       

      }

       

      but then I read flash it is all 0x0000,can you help me