OpenOCD
stm32l4x.c File Reference
Include dependency graph for stm32l4x.c:

Go to the source code of this file.

Data Structures

struct  range
 
struct  stm32l4_flash_bank
 
struct  stm32l4_part_info
 
struct  stm32l4_rev
 
struct  stm32l4_wrp
 

Macros

#define F_HAS_DUAL_BANK   BIT(0)
 
#define F_HAS_L5_FLASH_REGS   BIT(3)
 
#define F_HAS_TZ   BIT(2)
 
#define F_NONE   0
 
#define F_QUAD_WORD_PROG   BIT(4)
 
#define F_USE_ALL_WRPXX   BIT(1)
 
#define FLASH_ERASE_TIMEOUT   250
 
#define FLASH_WRITE_TIMEOUT   50
 

Enumerations

enum  stm32_bank_id { STM32_BANK1 , STM32_BANK2 , STM32_ALL_BANKS }
 
enum  stm32l4_flash_reg_index {
  STM32_FLASH_ACR_INDEX , STM32_FLASH_KEYR_INDEX , STM32_FLASH_OPTKEYR_INDEX , STM32_FLASH_SR_INDEX ,
  STM32_FLASH_CR_INDEX , STM32_FLASH_CR_WLK_INDEX , STM32_FLASH_OPTR_INDEX , STM32_FLASH_WRP1AR_INDEX ,
  STM32_FLASH_WRP1BR_INDEX , STM32_FLASH_WRP2AR_INDEX , STM32_FLASH_WRP2BR_INDEX , STM32_FLASH_REG_INDEX_NUM
}
 
enum  stm32l4_rdp { RDP_LEVEL_0 = 0xAA , RDP_LEVEL_0_5 = 0x55 , RDP_LEVEL_1 = 0x00 , RDP_LEVEL_2 = 0xCC }
 

Functions

static void bitmap_to_ranges (unsigned long *bitmap, unsigned int nbits, struct range *ranges, unsigned int *ranges_count)
 
 COMMAND_HANDLER (stm32l4_handle_lock_command)
 
 COMMAND_HANDLER (stm32l4_handle_mass_erase_command)
 
 COMMAND_HANDLER (stm32l4_handle_option_load_command)
 
 COMMAND_HANDLER (stm32l4_handle_option_read_command)
 
 COMMAND_HANDLER (stm32l4_handle_option_write_command)
 
 COMMAND_HANDLER (stm32l4_handle_otp_command)
 
 COMMAND_HANDLER (stm32l4_handle_trustzone_command)
 
 COMMAND_HANDLER (stm32l4_handle_unlock_command)
 
 COMMAND_HANDLER (stm32l4_handle_wrp_info_command)
 
 FLASH_BANK_COMMAND_HANDLER (stm32l4_flash_bank_command)
 
static const char * get_stm32l4_bank_type_str (struct flash_bank *bank)
 
static int get_stm32l4_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static const char * get_stm32l4_rev_str (struct flash_bank *bank)
 
static char * range_print_alloc (struct range *ranges, unsigned int ranges_count)
 
static int range_print_one (struct range *range, char *str)
 
static int stm32l4_auto_probe (struct flash_bank *bank)
 
static int stm32l4_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int stm32l4_get_all_wrpxy (struct flash_bank *bank, enum stm32_bank_id dev_bank_id, struct stm32l4_wrp *wrpxy, unsigned int *n_wrp)
 
static int stm32l4_get_flash_cr_with_lock_index (struct flash_bank *bank)
 
static uint32_t stm32l4_get_flash_reg (struct flash_bank *bank, uint32_t reg_offset)
 
static uint32_t stm32l4_get_flash_reg_by_index (struct flash_bank *bank, enum stm32l4_flash_reg_index reg_index)
 
static int stm32l4_get_one_wrpxy (struct flash_bank *bank, struct stm32l4_wrp *wrpxy, enum stm32l4_flash_reg_index reg_idx, int offset)
 
static bool stm32l4_is_otp (struct flash_bank *bank)
 
static int stm32l4_mass_erase (struct flash_bank *bank)
 
static int stm32l4_otp_enable (struct flash_bank *bank, bool enable)
 
static bool stm32l4_otp_is_enabled (struct flash_bank *bank)
 
static int stm32l4_perform_obl_launch (struct flash_bank *bank)
 
static int stm32l4_probe (struct flash_bank *bank)
 
static int stm32l4_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last)
 
static int stm32l4_protect_check (struct flash_bank *bank)
 
static int stm32l4_protect_same_bank (struct flash_bank *bank, enum stm32_bank_id bank_id, int set, unsigned int first, unsigned int last)
 
static int stm32l4_read_flash_reg (struct flash_bank *bank, uint32_t reg_offset, uint32_t *value)
 
static int stm32l4_read_flash_reg_by_index (struct flash_bank *bank, enum stm32l4_flash_reg_index reg_index, uint32_t *value)
 
static int stm32l4_read_idcode (struct flash_bank *bank, uint32_t *id)
 
static int stm32l4_set_secbb (struct flash_bank *bank, uint32_t value)
 set all FLASH_SECBB registers to the same value More...
 
static void stm32l4_sync_rdp_tzen (struct flash_bank *bank)
 
static int stm32l4_unlock_option_reg (struct flash_bank *bank)
 
static int stm32l4_unlock_reg (struct flash_bank *bank)
 
static int stm32l4_wait_status_busy (struct flash_bank *bank, int timeout)
 
static int stm32l4_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int stm32l4_write_all_wrpxy (struct flash_bank *bank, struct stm32l4_wrp *wrpxy, unsigned int n_wrp)
 
static int stm32l4_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int stm32l4_write_block_without_loader (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int stm32l4_write_flash_reg (struct flash_bank *bank, uint32_t reg_offset, uint32_t value)
 
static int stm32l4_write_flash_reg_by_index (struct flash_bank *bank, enum stm32l4_flash_reg_index reg_index, uint32_t value)
 
static int stm32l4_write_one_wrpxy (struct flash_bank *bank, struct stm32l4_wrp *wrpxy)
 
static int stm32l4_write_option (struct flash_bank *bank, uint32_t reg_offset, uint32_t value, uint32_t mask)
 

Variables

static const char * device_families = "STM32G0/G4/L4/L4+/L5/U5/WB/WL"
 
static const struct stm32l4_rev stm32_g07_g08xx_revs []
 
static const struct stm32l4_rev stm32g03_g04xx_revs []
 
static const struct stm32l4_rev stm32g05_g06xx_revs []
 
static const struct stm32l4_rev stm32g0b_g0cxx_revs []
 
static const struct stm32l4_rev stm32g43_g44xx_revs []
 
static const struct stm32l4_rev stm32g47_g48xx_revs []
 
static const struct stm32l4_rev stm32g49_g4axx_revs []
 
static const struct stm32l4_rev stm32l41_l42xx_revs []
 
static const struct stm32l4_rev stm32l43_l44xx_revs []
 
static const struct stm32l4_rev stm32l45_l46xx_revs []
 
static const struct stm32l4_rev stm32l47_l48xx_revs []
 
static const struct stm32l4_rev stm32l49_l4axx_revs []
 
static const struct command_registration stm32l4_command_handlers []
 
static const struct command_registration stm32l4_exec_command_handlers []
 
static const uint32_t stm32l4_flash_regs [STM32_FLASH_REG_INDEX_NUM]
 
static const struct stm32l4_part_info stm32l4_parts []
 
static const struct stm32l4_rev stm32l4p_l4qxx_revs []
 
static const struct stm32l4_rev stm32l4r_l4sxx_revs []
 
const struct flash_driver stm32l4x_flash
 
static const struct stm32l4_rev stm32l55_l56xx_revs []
 
static const uint32_t stm32l5_ns_flash_regs [STM32_FLASH_REG_INDEX_NUM]
 
static const uint32_t stm32l5_s_flash_regs [STM32_FLASH_REG_INDEX_NUM]
 
static const struct stm32l4_rev stm32u57_u58xx_revs []
 
static const struct stm32l4_rev stm32wb1xx_revs []
 
static const struct stm32l4_rev stm32wb3xx_revs []
 
static const struct stm32l4_rev stm32wb5xx_revs []
 
static const uint32_t stm32wl_cpu2_flash_regs [STM32_FLASH_REG_INDEX_NUM]
 
static const struct stm32l4_rev stm32wle_wl5xx_revs []
 

Macro Definition Documentation

◆ F_HAS_DUAL_BANK

#define F_HAS_DUAL_BANK   BIT(0)

Definition at line 123 of file stm32l4x.c.

◆ F_HAS_L5_FLASH_REGS

#define F_HAS_L5_FLASH_REGS   BIT(3)

Definition at line 130 of file stm32l4x.c.

◆ F_HAS_TZ

#define F_HAS_TZ   BIT(2)

Definition at line 128 of file stm32l4x.c.

◆ F_NONE

#define F_NONE   0

Definition at line 121 of file stm32l4x.c.

◆ F_QUAD_WORD_PROG

#define F_QUAD_WORD_PROG   BIT(4)

Definition at line 133 of file stm32l4x.c.

◆ F_USE_ALL_WRPXX

#define F_USE_ALL_WRPXX   BIT(1)

Definition at line 126 of file stm32l4x.c.

◆ FLASH_ERASE_TIMEOUT

#define FLASH_ERASE_TIMEOUT   250

Definition at line 116 of file stm32l4x.c.

◆ FLASH_WRITE_TIMEOUT

#define FLASH_WRITE_TIMEOUT   50

Definition at line 117 of file stm32l4x.c.

Enumeration Type Documentation

◆ stm32_bank_id

Enumerator
STM32_BANK1 
STM32_BANK2 
STM32_ALL_BANKS 

Definition at line 250 of file stm32l4x.c.

◆ stm32l4_flash_reg_index

Enumerator
STM32_FLASH_ACR_INDEX 
STM32_FLASH_KEYR_INDEX 
STM32_FLASH_OPTKEYR_INDEX 
STM32_FLASH_SR_INDEX 
STM32_FLASH_CR_INDEX 
STM32_FLASH_CR_WLK_INDEX 
STM32_FLASH_OPTR_INDEX 
STM32_FLASH_WRP1AR_INDEX 
STM32_FLASH_WRP1BR_INDEX 
STM32_FLASH_WRP2AR_INDEX 
STM32_FLASH_WRP2BR_INDEX 
STM32_FLASH_REG_INDEX_NUM 

Definition at line 137 of file stm32l4x.c.

◆ stm32l4_rdp

Enumerator
RDP_LEVEL_0 
RDP_LEVEL_0_5 
RDP_LEVEL_1 
RDP_LEVEL_2 

Definition at line 154 of file stm32l4x.c.

Function Documentation

◆ bitmap_to_ranges()

static void bitmap_to_ranges ( unsigned long *  bitmap,
unsigned int  nbits,
struct range ranges,
unsigned int *  ranges_count 
)
static

Definition at line 621 of file stm32l4x.c.

References range::end, range::start, and test_bit().

Referenced by COMMAND_HANDLER(), and stm32l4_protect_same_bank().

◆ COMMAND_HANDLER() [1/9]

◆ COMMAND_HANDLER() [2/9]

COMMAND_HANDLER ( stm32l4_handle_mass_erase_command  )

◆ COMMAND_HANDLER() [3/9]

COMMAND_HANDLER ( stm32l4_handle_option_load_command  )

◆ COMMAND_HANDLER() [4/9]

COMMAND_HANDLER ( stm32l4_handle_option_read_command  )

◆ COMMAND_HANDLER() [5/9]

COMMAND_HANDLER ( stm32l4_handle_option_write_command  )

◆ COMMAND_HANDLER() [6/9]

COMMAND_HANDLER ( stm32l4_handle_otp_command  )

◆ COMMAND_HANDLER() [7/9]

◆ COMMAND_HANDLER() [8/9]

◆ COMMAND_HANDLER() [9/9]

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( stm32l4_flash_bank_command  )

◆ get_stm32l4_bank_type_str()

static const char* get_stm32l4_bank_type_str ( struct flash_bank bank)
static

◆ get_stm32l4_info()

◆ get_stm32l4_rev_str()

static const char* get_stm32l4_rev_str ( struct flash_bank bank)
static

◆ range_print_alloc()

static char* range_print_alloc ( struct range ranges,
unsigned int  ranges_count 
)
static

Definition at line 649 of file stm32l4x.c.

References range_print_one().

Referenced by COMMAND_HANDLER(), and stm32l4_protect_same_bank().

◆ range_print_one()

static int range_print_one ( struct range range,
char *  str 
)
inlinestatic

Definition at line 641 of file stm32l4x.c.

References range::end, and range::start.

Referenced by range_print_alloc().

◆ stm32l4_auto_probe()

◆ stm32l4_erase()

◆ stm32l4_get_all_wrpxy()

◆ stm32l4_get_flash_cr_with_lock_index()

static int stm32l4_get_flash_cr_with_lock_index ( struct flash_bank bank)
inlinestatic

◆ stm32l4_get_flash_reg()

static uint32_t stm32l4_get_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset 
)
inlinestatic

◆ stm32l4_get_flash_reg_by_index()

static uint32_t stm32l4_get_flash_reg_by_index ( struct flash_bank bank,
enum stm32l4_flash_reg_index  reg_index 
)
inlinestatic

Definition at line 738 of file stm32l4x.c.

References bank, stm32l4_flash_bank::flash_regs, and stm32l4_get_flash_reg().

Referenced by stm32l4_write_block().

◆ stm32l4_get_one_wrpxy()

static int stm32l4_get_one_wrpxy ( struct flash_bank bank,
struct stm32l4_wrp wrpxy,
enum stm32l4_flash_reg_index  reg_idx,
int  offset 
)
static

◆ stm32l4_is_otp()

◆ stm32l4_mass_erase()

◆ stm32l4_otp_enable()

static int stm32l4_otp_enable ( struct flash_bank bank,
bool  enable 
)
static

Definition at line 678 of file stm32l4x.c.

References bank, ERROR_FAIL, ERROR_OK, LOG_INFO, stm32l4_flash_bank::otp_enabled, and stm32l4_is_otp().

Referenced by COMMAND_HANDLER().

◆ stm32l4_otp_is_enabled()

static bool stm32l4_otp_is_enabled ( struct flash_bank bank)
inlinestatic

Definition at line 697 of file stm32l4x.c.

References bank, and stm32l4_flash_bank::otp_enabled.

Referenced by COMMAND_HANDLER(), and stm32l4_write().

◆ stm32l4_perform_obl_launch()

◆ stm32l4_probe()

static int stm32l4_probe ( struct flash_bank bank)
static

Definition at line 1690 of file stm32l4x.c.

References alloc_block_array(), adiv5_ap::ap_num, ARRAY_SIZE, bank, stm32l4_flash_bank::bank1_sectors, stm32l4_flash_bank::cr_bker_mask, stm32l4_flash_bank::data_width, armv7m_common::debug_ap, device_families, stm32l4_part_info::device_str, DEVID_STM32G03_G04XX, DEVID_STM32G05_G06XX, DEVID_STM32G07_G08XX, DEVID_STM32G0B_G0CXX, DEVID_STM32G43_G44XX, DEVID_STM32G47_G48XX, DEVID_STM32G49_G4AXX, DEVID_STM32L41_L42XX, DEVID_STM32L43_L44XX, DEVID_STM32L45_L46XX, DEVID_STM32L47_L48XX, DEVID_STM32L49_L4AXX, DEVID_STM32L4P_L4QXX, DEVID_STM32L4R_L4SXX, DEVID_STM32L55_L56XX, DEVID_STM32U57_U58XX, DEVID_STM32WB1XX, DEVID_STM32WB3XX, DEVID_STM32WB5XX, DEVID_STM32WLE_WL5XX, stm32l4_flash_bank::dual_bank_mode, ERROR_FAIL, ERROR_NOT_IMPLEMENTED, ERROR_OK, ERROR_TARGET_INVALID, ERROR_TARGET_NOT_EXAMINED, F_HAS_L5_FLASH_REGS, F_HAS_TZ, F_QUAD_WORD_PROG, stm32l4_part_info::flags, FLASH_BKER, FLASH_BKER_G0, FLASH_BSY, FLASH_BSY2, FLASH_G0_DUAL_BANK, FLASH_G4_DUAL_BANK, FLASH_L4_DUAL_BANK, FLASH_L4R_DBANK, FLASH_L5_DB256, FLASH_L5_DBANK, FLASH_LRR_DB1M, stm32l4_flash_bank::flash_regs, stm32l4_part_info::flash_regs_base, stm32l4_flash_bank::flash_regs_base, FLASH_U5_DUALBANK, stm32l4_part_info::fsize_addr, get_stm32l4_rev_str(), stm32l4_flash_bank::hole_sectors, stm32l4_flash_bank::idcode, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, stm32l4_part_info::max_flash_size_kb, stm32l4_flash_bank::optr, stm32l4_part_info::otp_size, stm32l4_flash_bank::part_info, stm32l4_flash_bank::probed, stm32l4_flash_bank::rdp, RDP_LEVEL_0, RDP_LEVEL_0_5, stm32l4_flash_bank::sr_bsy_mask, STM32_FLASH_BANK_BASE, STM32_FLASH_OPTR_INDEX, STM32_FLASH_S_BANK_BASE, stm32l4_flash_regs, stm32l4_is_otp(), stm32l4_parts, stm32l4_read_flash_reg_by_index(), stm32l4_read_idcode(), stm32l4_sync_rdp_tzen(), stm32l5_ns_flash_regs, STM32L5_REGS_SEC_OFFSET, stm32l5_s_flash_regs, stm32wl_cpu2_flash_regs, TARGET_ADDR_FMT, target_read_u16(), target_to_armv7m_safe(), target_was_examined(), stm32l4_flash_bank::tzen, stm32l4_flash_bank::user_bank_size, and stm32l4_flash_bank::wrpxxr_mask.

Referenced by stm32l4_auto_probe().

◆ stm32l4_protect()

static int stm32l4_protect ( struct flash_bank bank,
int  set,
unsigned int  first,
unsigned int  last 
)
static

◆ stm32l4_protect_check()

static int stm32l4_protect_check ( struct flash_bank bank)
static

◆ stm32l4_protect_same_bank()

static int stm32l4_protect_same_bank ( struct flash_bank bank,
enum stm32_bank_id  bank_id,
int  set,
unsigned int  first,
unsigned int  last 
)
static

◆ stm32l4_read_flash_reg()

static int stm32l4_read_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset,
uint32_t *  value 
)
inlinestatic

◆ stm32l4_read_flash_reg_by_index()

static int stm32l4_read_flash_reg_by_index ( struct flash_bank bank,
enum stm32l4_flash_reg_index  reg_index,
uint32_t *  value 
)
inlinestatic

◆ stm32l4_read_idcode()

◆ stm32l4_set_secbb()

static int stm32l4_set_secbb ( struct flash_bank bank,
uint32_t  value 
)
static

◆ stm32l4_sync_rdp_tzen()

◆ stm32l4_unlock_option_reg()

◆ stm32l4_unlock_reg()

◆ stm32l4_wait_status_busy()

◆ stm32l4_write()

◆ stm32l4_write_all_wrpxy()

static int stm32l4_write_all_wrpxy ( struct flash_bank bank,
struct stm32l4_wrp wrpxy,
unsigned int  n_wrp 
)
static

Definition at line 1097 of file stm32l4x.c.

References bank, ERROR_OK, and stm32l4_write_one_wrpxy().

Referenced by stm32l4_protect_same_bank().

◆ stm32l4_write_block()

◆ stm32l4_write_block_without_loader()

static int stm32l4_write_block_without_loader ( struct flash_bank bank,
const uint8_t *  buffer,
uint32_t  offset,
uint32_t  count 
)
static

◆ stm32l4_write_flash_reg()

static int stm32l4_write_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset,
uint32_t  value 
)
inlinestatic

◆ stm32l4_write_flash_reg_by_index()

◆ stm32l4_write_one_wrpxy()

static int stm32l4_write_one_wrpxy ( struct flash_bank bank,
struct stm32l4_wrp wrpxy 
)
static

◆ stm32l4_write_option()

Variable Documentation

◆ device_families

const char* device_families = "STM32G0/G4/L4/L4+/L5/U5/WB/WL"
static

Definition at line 266 of file stm32l4x.c.

Referenced by get_stm32l4_info(), and stm32l4_probe().

◆ stm32_g07_g08xx_revs

const struct stm32l4_rev stm32_g07_g08xx_revs[]
static
Initial value:
= {
{ 0x1000, "A/Z" } , { 0x2000, "B" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32g03_g04xx_revs

const struct stm32l4_rev stm32g03_g04xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x2000, "B" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32g05_g06xx_revs

const struct stm32l4_rev stm32g05_g06xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32g0b_g0cxx_revs

const struct stm32l4_rev stm32g0b_g0cxx_revs[]
static
Initial value:
= {
{ 0x1000, "A" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32g43_g44xx_revs

const struct stm32l4_rev stm32g43_g44xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x2000, "B" }, { 0x2001, "Z" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32g47_g48xx_revs

const struct stm32l4_rev stm32g47_g48xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x2000, "B" }, { 0x2001, "Z" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32g49_g4axx_revs

const struct stm32l4_rev stm32g49_g4axx_revs[]
static
Initial value:
= {
{ 0x1000, "A" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l41_l42xx_revs

const struct stm32l4_rev stm32l41_l42xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x2001, "Y" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l43_l44xx_revs

const struct stm32l4_rev stm32l43_l44xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x2001, "Y" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l45_l46xx_revs

const struct stm32l4_rev stm32l45_l46xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x2001, "Y" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l47_l48xx_revs

const struct stm32l4_rev stm32l47_l48xx_revs[]
static
Initial value:
= {
{ 0x1000, "1" }, { 0x1001, "2" }, { 0x1003, "3" }, { 0x1007, "4" }
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l49_l4axx_revs

const struct stm32l4_rev stm32l49_l4axx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x2000, "B" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l4_command_handlers

const struct command_registration stm32l4_command_handlers[]
static
Initial value:
= {
{
.name = "stm32l4x",
.mode = COMMAND_ANY,
.help = "stm32l4x flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration stm32l4_exec_command_handlers[]
Definition: stm32l4x.c:2479

Definition at line 2452 of file stm32l4x.c.

◆ stm32l4_exec_command_handlers

const struct command_registration stm32l4_exec_command_handlers[]
static

Definition at line 2452 of file stm32l4x.c.

◆ stm32l4_flash_regs

const uint32_t stm32l4_flash_regs[STM32_FLASH_REG_INDEX_NUM]
static
Initial value:
= {
}
@ STM32_FLASH_SR_INDEX
Definition: stm32l4x.c:141
@ STM32_FLASH_ACR_INDEX
Definition: stm32l4x.c:138
@ STM32_FLASH_OPTR_INDEX
Definition: stm32l4x.c:146
@ STM32_FLASH_WRP1AR_INDEX
Definition: stm32l4x.c:147
@ STM32_FLASH_CR_INDEX
Definition: stm32l4x.c:142
@ STM32_FLASH_WRP2BR_INDEX
Definition: stm32l4x.c:150
@ STM32_FLASH_OPTKEYR_INDEX
Definition: stm32l4x.c:140
@ STM32_FLASH_WRP1BR_INDEX
Definition: stm32l4x.c:148
@ STM32_FLASH_KEYR_INDEX
Definition: stm32l4x.c:139
@ STM32_FLASH_WRP2AR_INDEX
Definition: stm32l4x.c:149

Definition at line 161 of file stm32l4x.c.

Referenced by stm32l4_probe().

◆ stm32l4_parts

const struct stm32l4_part_info stm32l4_parts[]
static

Definition at line 266 of file stm32l4x.c.

Referenced by stm32l4_probe().

◆ stm32l4p_l4qxx_revs

const struct stm32l4_rev stm32l4p_l4qxx_revs[]
static
Initial value:
= {
{ 0x1001, "Z" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l4r_l4sxx_revs

const struct stm32l4_rev stm32l4r_l4sxx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x1003, "Y" }, { 0x100F, "W" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l4x_flash

const struct flash_driver stm32l4x_flash
Initial value:
= {
.name = "stm32l4x",
.flash_bank_command = stm32l4_flash_bank_command,
.erase = stm32l4_erase,
.protect = stm32l4_protect,
.write = stm32l4_write,
.probe = stm32l4_probe,
.auto_probe = stm32l4_auto_probe,
.erase_check = default_flash_blank_check,
.protect_check = stm32l4_protect_check,
.free_driver_priv = default_flash_free_driver_priv,
}
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
int default_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default read implementation for flash memory.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
static int stm32l4_protect_check(struct flash_bank *bank)
Definition: stm32l4x.c:1110
static const struct command_registration stm32l4_command_handlers[]
Definition: stm32l4x.c:2546
static int stm32l4_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: stm32l4x.c:1134
static int get_stm32l4_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: stm32l4x.c:2066
static int stm32l4_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: stm32l4x.c:1507
static int stm32l4_probe(struct flash_bank *bank)
Definition: stm32l4x.c:1690
static int stm32l4_protect(struct flash_bank *bank, int set, unsigned int first, unsigned int last)
Definition: stm32l4x.c:1303
static int stm32l4_auto_probe(struct flash_bank *bank)
Definition: stm32l4x.c:2037

Definition at line 2452 of file stm32l4x.c.

◆ stm32l55_l56xx_revs

const struct stm32l4_rev stm32l55_l56xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x2000, "B" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32l5_ns_flash_regs

const uint32_t stm32l5_ns_flash_regs[STM32_FLASH_REG_INDEX_NUM]
static
Initial value:

Definition at line 186 of file stm32l4x.c.

Referenced by stm32l4_probe(), and stm32l4_write_option().

◆ stm32l5_s_flash_regs

const uint32_t stm32l5_s_flash_regs[STM32_FLASH_REG_INDEX_NUM]
static
Initial value:

Definition at line 199 of file stm32l4x.c.

Referenced by stm32l4_probe().

◆ stm32u57_u58xx_revs

const struct stm32l4_rev stm32u57_u58xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x1003, "Y" }, { 0x2000, "B" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32wb1xx_revs

const struct stm32l4_rev stm32wb1xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" }, { 0x2000, "B" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32wb3xx_revs

const struct stm32l4_rev stm32wb3xx_revs[]
static
Initial value:
= {
{ 0x1000, "A" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32wb5xx_revs

const struct stm32l4_rev stm32wb5xx_revs[]
static
Initial value:
= {
{ 0x2001, "2.1" },
}

Definition at line 266 of file stm32l4x.c.

◆ stm32wl_cpu2_flash_regs

const uint32_t stm32wl_cpu2_flash_regs[STM32_FLASH_REG_INDEX_NUM]
static
Initial value:

Definition at line 174 of file stm32l4x.c.

Referenced by stm32l4_probe().

◆ stm32wle_wl5xx_revs

const struct stm32l4_rev stm32wle_wl5xx_revs[]
static
Initial value:
= {
{ 0x1000, "1.0" },
}

Definition at line 266 of file stm32l4x.c.