AnsweredAssumed Answered

ADUCM360:whether an unsigned char data can be stored as one byte in FLASH?

Question asked by bomlulu on Dec 7, 2015
Latest reply on Dec 8, 2015 by ABuda

In the example code FlashWrite:

void WriteToFlash(unsigned long *pArray, unsigned long ulStartAddress, unsigned int uiSize)
{
   unsigned int uiPollFEESTA = 0;
   volatile unsigned long *flashAddress;
   unsigned int i = 0;
   
   flashAddress = ( unsigned long      *)ulStartAddress;
   FeeWrEn(1);
   uiPollFEESTA = FeeSta(); // Read Status to ensure it is clear
   for (i = 0; i < uiSize; i = i+4)
   { 
      uiPollFEESTA = 0;
      *flashAddress++  = *pArray++;
      do
         {uiPollFEESTA = FeeSta();}
       while((uiPollFEESTA & FEESTA_CMDBUSY) == FEESTA_CMDBUSY);
   }  
   FeeWrEn(0);       // disable a write to Flash memory
}

After flashAddress++,flashAddress adds 4.

For example, flashAddress=0x1f000 at begin,after flashAddress++,flashAddress=0x1f004.

whether an unsigned char data can be stored as one byte in FLASH?

Outcomes