2007-09-02 10:11 PM
write data to the same flash bank
2011-05-17 12:46 AM
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 ?2011-05-17 12:46 AM
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.