]> git.sur5r.net Git - openocd/commitdiff
- update sectors on stm32x mass erase
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 24 May 2008 14:19:42 +0000 (14:19 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 24 May 2008 14:19:42 +0000 (14:19 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@681 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/stm32x.c

index 6742d010ae65083e180931009484f70a3b6fd8e3..d3e167d911f69e46eda67743e71f776b4de641f4 100644 (file)
@@ -935,6 +935,7 @@ int stm32x_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cm
        stm32x_flash_bank_t *stm32x_info = NULL;
        flash_bank_t *bank;
        u32 status;
+       int i;
        
        if (argc < 1)
        {
@@ -982,6 +983,12 @@ int stm32x_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cm
                return ERROR_OK;
        }
        
+       /* set all sectors as erased */
+       for (i = 0; i < bank->num_sectors; i++)
+       {
+               bank->sectors[i].is_erased = 1;
+       }
+       
        command_print(cmd_ctx, "stm32x mass erase complete");
        
        return ERROR_OK;