]> git.sur5r.net Git - openocd/commitdiff
- added check for revA silicon in stm32 flash driver
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 14 Feb 2008 10:02:51 +0000 (10:02 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 14 Feb 2008 10:02:51 +0000 (10:02 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@294 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/stm32x.c

index 7039a3d41d012bc1d7995714b0b1a58d7b196b95..8363039f8e335836ad52198f06fd333f40f0ea25 100644 (file)
@@ -660,6 +660,15 @@ int stm32x_probe(struct flash_bank_s *bank)
     
        /* get flash size from target */
        target_read_u16(target, 0x1FFFF7E0, &num_sectors);
+       
+       /* check for early silicon rev A */
+       if ((device_id >> 16) == 0 )
+       {
+               /* number of sectors incorrect on revA */
+               WARNING( "STM32 Rev A Silicon detected, probe inaccurate - assuming 128k flash" );
+               num_sectors = 128;
+       }
+       
        INFO( "flash size = %dkbytes", num_sectors );
        
        bank->base = 0x08000000;