bool has_dual_banks;
/* used to access dual flash bank stm32xl */
uint32_t register_base;
+ uint16_t default_rdp;
int user_data_offset;
};
/* clear readout protection and complementary option bytes
* this will also force a device unlock if set */
- stm32x_info->option_bytes.RDP = 0x5AA5;
+ stm32x_info->option_bytes.RDP = stm32x_info->default_rdp;
return ERROR_OK;
}
stm32x_info->register_base = FLASH_REG_BASE_B0;
stm32x_info->user_data_offset = 10;
+ /* default factory protection level */
+ stm32x_info->default_rdp = 0x5AA5;
+
/* read stm32 device id register */
int retval = stm32x_get_device_id(bank, &device_id);
if (retval != ERROR_OK)
stm32x_info->ppage_size = 2;
max_flash_size_in_kb = 256;
stm32x_info->user_data_offset = 16;
+ stm32x_info->default_rdp = 0x55AA;
break;
case 0x428: /* value line High density */
page_size = 2048;
stm32x_info->ppage_size = 2;
max_flash_size_in_kb = 256;
stm32x_info->user_data_offset = 16;
+ stm32x_info->default_rdp = 0x55AA;
break;
case 0x440: /* stm32f0x */
page_size = 1024;
stm32x_info->ppage_size = 4;
max_flash_size_in_kb = 64;
stm32x_info->user_data_offset = 16;
+ stm32x_info->default_rdp = 0x55AA;
break;
default:
LOG_WARNING("Cannot identify target as a STM32 family.");