How to Read from 4kB Flash Data of ADuCM330

Hello!

We are using ADuCM330 in our project. Our questions are:

1: Is it possible to save some data ( in the form of matrix or float variables ) on flash 4kB data location and also access (read) this data time to time through the execution code.    

2:  In the hardware manual only WRITING and ERASING commands are mentioned for flash 4kB data. If READING data from flash 4kB data location is possible then can you share some example code of WRITING and READING data from 4kB flash data?

  • 0
    •  Analog Employees 
    on Jun 19, 2017 6:59 AM

    Hello,

    Please refere to the Flash Controller Access Matrix (Table 43) on page 33 of the Hardware Reference Manual.

    Kind Regards

    Holger

  • 0
    •  Analog Employees 
    on Jul 11, 2017 5:39 AM

    Hello,

     

    see example below

     

    unsigned int nData = 0x12345678;           
    unsigned int pData[2];

     

     FLASH_Word_Write(DataFlash_Base+0x100,nData);           
     FLASH_Word_Read(DataFlash_Base+0x100, pData);

     

    //====================================================================
    //      Flash write 64bits
    //====================================================================
    FLASH_RESULT_TYPE FLASH_Word_Write ( int nAddress, int pData )
    {
        volatile unsigned int uiSTA;         // Variable for FEESTA

        FEEADR = nAddress;
        FEEDATL = pData;
        FEEDATH = pData;
        // FEEDAT2 = (unsigned char)Data00ToWrite32BitReg;    // ECC location, write also for endurance testing.

        FEECMD = FLSH_WRITE;             // Write to the FLASH
        do{
             do{
               uiSTA = FEESTA;
            }while(uiSTA & CMD_BUSY);
        }while(!(uiSTA & CMD_COMPLETE));

        if((uiSTA == 0x04)||(uiSTA == 0x0C))     // completed
        {
            return FLASH_SUCCESS;
        }
          else
        {
            return FLASH_ERROR;
        }
    }

     

    /*************************************************************************************************/
    /* Read a 64bit data word from Flash. Takes word aligned address and returns via pointer     */
    /*************************************************************************************************/
    void FLASH_Word_Read (unsigned int nAddress, unsigned int *pData )
    {
        unsigned int *pFlash        = 0;
     
        pFlash = (unsigned int *)nAddress;

        *(pData) = *(pFlash);
        *(++pData ) = *(++pFlash);

    }

     

     

    I hope this helps
    regards

    Holger

  • Hello!

    I also want to know how to solve this problem.

    I was read  article of hardware manual and  also read Flash Controller Access Matrix (Table 43) on page 33.

    but my customer still can not read data from flash

    I know that I can read data from flash, but I don't know how can I read data.

    Can anyone suggest or share a practical method for data reading from flash.(example code, command  etc) 

    thanks

  • Hello Holger!

    I have studied almost all the portion of hardware Reference Manual about Flash but can not understand the concept of Reading from it. We used ADuC7036 before and in that MCU there is a specific register "FEE0CON" which has the options of both Reading and Writing from Flash. But in ADuCM330 , we have "FEECMD" but it don't have the option of reading data. 

    Can you please tell us that how can we  select the Reading Mode in ADuCM330.

    Regards,

  • Hey Andrew!

    I am also still looking for the answer. I hope Mr. Holger will get back here soon.