2007-11-12 09:51 PM
Problem Erasing Bank 0 (Boot Bank)
2011-05-17 12:47 AM
I am having trouble erasing Bank 0 which the code text of my program is in. I have configured the FMI as in the example provided by ST:
Configure bank 0 as 512KB and bank 1 as 32KB */ /* Configure bank 0 at address 0x0 and bank 1 at address 0x80000 SCU_AHBPeriphClockConfig(__FMI, ENABLE); SCU_AHBPeriphReset(__FMI, DISABLE); FMI_BankRemapConfig(0x4, 0x2, 0x0, 0x80000); I put the following code in RAM (using __ramfunc) to erase the code text of my program from Bank 0 but my program resets when this is called and the sector has not been erased. I disable interrupts before executing this code. // Disable write protection on the specified sector FMI_WriteProtectionCmd(CODE_SECTOR1, DISABLE); // Erase the specified sector FMI_EraseSector(CODE_SECTOR1); if (FMI_WaitForLastOperation(FMI_BANK_0) == FMI_TIME_OUT_ERROR) { return(false); } // Enable write protection on the specified sector FMI_WriteProtectionCmd(CODE_SECTOR1, ENABLE); I have verified I can erase sectors in Bank 1. Are there additional steps necessary to erase code text from Bank 0?