]> git.sur5r.net Git - openocd/commitdiff
Fix Sam3u flash bank 1 issue
authorolivier Schonken <olivier.schonken@gmail.com>
Sat, 20 Aug 2011 14:31:35 +0000 (16:31 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sun, 21 Aug 2011 17:37:20 +0000 (19:37 +0200)
src/flash/nor/at91sam3.c

index 40ff3aa0a15b8692a8b6db40c07c55e1ad9b79aa..1fe5f6206faab384f600d00cdeae982791d5d996 100644 (file)
@@ -1974,6 +1974,7 @@ FLASH_BANK_COMMAND_HANDLER(sam3_flash_bank_command)
                bank->bank_number = 1;
                pChip->details.bank[1].pChip = pChip;
                pChip->details.bank[1].pBank = bank;
+               break;
 
        // at91sam3s series
        case FLASH_BANK_BASE_S:
@@ -2091,8 +2092,8 @@ _sam3_probe(struct flash_bank *bank, int noise)
 
        // update the flash bank size
        for (x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++) {
-               if (bank->base == pPrivate->pChip->details.bank[0].base_address) {
-                       bank->size =  pPrivate->pChip->details.bank[0].size_bytes;
+               if (bank->base == pPrivate->pChip->details.bank[x].base_address) {
+                       bank->size =  pPrivate->pChip->details.bank[x].size_bytes;
                        break;
                }
        }