Skip to main content
Visitor II
September 3, 2007
Question

write data to the same flash bank

  • September 3, 2007
  • 2 replies
  • 754 views
Posted on September 03, 2007 at 07:11

write data to the same flash bank

    This topic has been closed for replies.

    2 replies

    yuhleonAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:46

    Hi all,

    I want to write data from flash bank 0 to another sector which in bank 0 too, and my code is following:

    __ramfunc void copy_data(void)

    {

    SCU_AHBPeriphClockConfig(__FMI, ENABLE);

    SCU_AHBPeriphReset(__FMI, DISABLE);

    FMI_WriteProtectionCmd(FMI_B0S7, DISABLE);

    FMI_EraseSector(FMI_B0S7);

    FMI_WaitForLastOperation(FMI_BANK_1);

    }

    all functions in copy_data function is using __ramfunc too.

    But my program will dead when execute FMI_EraseSector function.

    Does anyone know how to write data to the same flash bank ?

    yuhleonAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:46

    Hi sword ,

    Thank you , now I can erase and write data to flash .

    But now I have a another problem.

    When I erase flash , my watchdog will timeout and reset.

    The datasheet said that WDG timer cannot set to Timer mode by software.

    So how can I disable watchdog when erasing flash ?

    I set the maximum value of PR[7:0] and TV[15:0]

    I only have PCLK and no RTC clock on my board.

    How can I set the timeout more than 2 seconds ?

    Because erasing 1 sector will use 0.8~0.9 second, if I can set the timeout more than 1.5 ~ 2 seconds , the problem can be solved.