Skip to content
  • CezaryGapinski's avatar
    stm32lx: fix dual-bank configuration for Cat.5 and Cat.6 devices · e916bcda
    CezaryGapinski authored
    
    
    Default values for .first_bank_size_kb and .has_dual_banks fields
    described in stm32lx_parts[] do not fully describe
    the real device memory layouts.
    
    Basing on:
    STM32L0x1 RM0377
    STM32L0x2 RM0376
    STM32L0x3 RM0367
    STM32Lxxxx RM0038
    
    correct values for memory layouts were selected:
    id = 0x447 STM32L0xx (Cat.5) <- dual bank flash
    for size 192 or 128 KBytes, single bank for 64 KBytes
    id = 0x436 STM32L1xx (Cat.4 / Cat.3 - Medium + /
    High Density) <- only one size of the bank,
    default values are correct
    id = 0x437 STM32L1xx (Cat.5 / Cat.6) <- always dual bank,
    but size of the bank can be different
    
    For that reason .part_info field in struct stm32lx_flash_bank
    is a dynamic field with fields copied from stm32lx_parts[]
    and overwriten to correct values
    for specific chips and memory sizes.
    
    Change-Id: If638cb0a9916097bfd4eda77d64feaf1ef2d2147
    Signed-off-by: default avatarCezary Gapiński <cezary.gapinski@gmail.com>
    Reviewed-on: http://openocd.zylin.com/4074
    
    
    Tested-by: jenkins
    Reviewed-by: default avatarAndreas Fritiofson <andreas.fritiofson@gmail.com>
    e916bcda