Skip to main content
Visitor II
June 12, 2006
Question

EEPROM EMULATOR on STR71x family CPU

  • June 12, 2006
  • 3 replies
  • 727 views
Posted on June 12, 2006 at 18:08

EEPROM EMULATOR on STR71x family CPU

    This topic has been closed for replies.

    3 replies

    jsayavongAuthor
    Visitor II
    June 10, 2006
    Posted on June 10, 2006 at 12:46

    I am having a problem trying to use internal flash (bank1)as EEPROM of STR71x family microprocessor. Using a HITEX eval board (purchased from Keil) and I copied code which I downloaded directly from ST website --- the result was, system hung immediately when I ran it. Could some STR71 expert(s) in this forum kindly take a look at the code below and then please tell me what I did wrong here?

    volatile unsigned long Data_Read;

    volatile unsigned long Write_Status;

    volatile unsigned long Read_Status;

    int main (void)

    {

    EEPROM_Init(); //initialize EEPROM

    // ------------ dataset#1 ------------

    Write_Status = EEPROM_DataWrite(0x11111111); ///<< system hung begins

    if (Write_Status == EEPROM_SUCCESSFUL_DATA_WRITE)

    {

    Read_Status = EEPROM_DataRead(&Data_Read);

    if (Read_Status == EEPROM_SUCCESSFUL_DATA_READ)

    printf(''The Valid Data-set is %x\n'',Data_Read);

    }

    // ------------dataset#2 ------------

    Write_Status = EEPROM_DataWrite(0x22222222);

    if (Write_Status == EEPROM_SUCCESSFUL_DATA_WRITE)

    {

    Read_Status = EEPROM_DataRead(&Data_Read);

    if (Read_Status == EEPROM_SUCCESSFUL_DATA_READ)

    printf(''The Valid Data-set is %x\n'',Data_Read);

    }

    // ------------ dataset#3 ------------

    Write_Status = EEPROM_DataWrite(0x33333333);

    if (Write_Status == EEPROM_SUCCESSFUL_DATA_WRITE)

    {

    Read_Status = EEPROM_DataRead(&Data_Read);

    if (Read_Status == EEPROM_SUCCESSFUL_DATA_READ)

    printf(''The Valid Data-set is %x\n'',Data_Read);

    }

    } //end main()

    jsayavongAuthor
    Visitor II
    June 12, 2006
    Posted on June 12, 2006 at 14:10

    Thanks for the reply. I am very new to the ARM

    enviroment. Looking into the reference manual you

    suggested, I still can figure out exactly where

    should the code be modified to execute from RAM.

    Could you please kindly modify my quote per

    your suggestion?

    Thanks for your help in advance,

    Regards,

    JIMMY

    jsayavongAuthor
    Visitor II
    June 12, 2006
    Posted on June 12, 2006 at 18:08

    Hi Sir,

    I read the Note on section 2.3 but I am still not

    be able to implement into my code above.

    Do you have a ''known'' working code so that I can

    try out on my eval board? to see if your theory is really

    work? I am using KEIL UV3 compiler (REALVIEW).

    My e-mail is:

    mailto:jsayavong@perkinselectronics.com

    if you

    don't mind sharing your code.

    Regards,

    JIMMY