OpenOCD
|
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) |
#define F_HAS_DUAL_BANK BIT(0) |
Definition at line 123 of file stm32l4x.c.
#define F_HAS_L5_FLASH_REGS BIT(3) |
Definition at line 130 of file stm32l4x.c.
#define F_HAS_TZ BIT(2) |
Definition at line 128 of file stm32l4x.c.
#define F_NONE 0 |
Definition at line 121 of file stm32l4x.c.
#define F_QUAD_WORD_PROG BIT(4) |
Definition at line 133 of file stm32l4x.c.
#define F_USE_ALL_WRPXX BIT(1) |
Definition at line 126 of file stm32l4x.c.
#define FLASH_ERASE_TIMEOUT 250 |
Definition at line 116 of file stm32l4x.c.
#define FLASH_WRITE_TIMEOUT 50 |
Definition at line 117 of file stm32l4x.c.
enum stm32_bank_id |
Enumerator | |
---|---|
STM32_BANK1 | |
STM32_BANK2 | |
STM32_ALL_BANKS |
Definition at line 250 of file stm32l4x.c.
Definition at line 137 of file stm32l4x.c.
enum stm32l4_rdp |
Enumerator | |
---|---|
RDP_LEVEL_0 | |
RDP_LEVEL_0_5 | |
RDP_LEVEL_1 | |
RDP_LEVEL_2 |
Definition at line 154 of file stm32l4x.c.
|
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 | ( | stm32l4_handle_lock_command | ) |
Definition at line 2311 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_RDP_MASK, stm32l4_flash_bank::flash_regs, LOG_ERROR, NULL, RDP_LEVEL_1, target::state, STM32_FLASH_OPTR_INDEX, stm32l4_is_otp(), stm32l4_write_option(), and TARGET_HALTED.
COMMAND_HANDLER | ( | stm32l4_handle_mass_erase_command | ) |
Definition at line 2150 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stm32l4_mass_erase().
COMMAND_HANDLER | ( | stm32l4_handle_option_load_command | ) |
Definition at line 2289 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stm32l4_perform_obl_launch().
COMMAND_HANDLER | ( | stm32l4_handle_option_read_command | ) |
Definition at line 2171 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, stm32l4_get_flash_reg(), and stm32l4_read_flash_reg().
COMMAND_HANDLER | ( | stm32l4_handle_option_write_command | ) |
Definition at line 2198 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, mask, and stm32l4_write_option().
COMMAND_HANDLER | ( | stm32l4_handle_otp_command | ) |
Definition at line 2452 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, stm32l4_is_otp(), stm32l4_otp_enable(), and stm32l4_otp_is_enabled().
COMMAND_HANDLER | ( | stm32l4_handle_trustzone_command | ) |
Definition at line 2228 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, F_HAS_TZ, stm32l4_part_info::flags, FLASH_RDP_MASK, stm32l4_flash_bank::flash_regs, FLASH_TZEN, LOG_ERROR, LOG_INFO, stm32l4_flash_bank::optr, stm32l4_flash_bank::part_info, stm32l4_flash_bank::rdp, RDP_LEVEL_0, RDP_LEVEL_0_5, RDP_LEVEL_1, STM32_FLASH_OPTR_INDEX, stm32l4_perform_obl_launch(), stm32l4_read_flash_reg_by_index(), stm32l4_sync_rdp_tzen(), stm32l4_write_option(), and stm32l4_flash_bank::tzen.
COMMAND_HANDLER | ( | stm32l4_handle_unlock_command | ) |
Definition at line 2346 of file stm32l4x.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_RDP_MASK, stm32l4_flash_bank::flash_regs, LOG_ERROR, NULL, RDP_LEVEL_0, target::state, STM32_FLASH_OPTR_INDEX, stm32l4_is_otp(), stm32l4_write_option(), and TARGET_HALTED.
COMMAND_HANDLER | ( | stm32l4_handle_wrp_info_command | ) |
Definition at line 2380 of file stm32l4x.c.
References bank, bitmap_to_ranges(), bitmap_zero(), CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), DECLARE_BITMAP, stm32l4_flash_bank::dual_bank_mode, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, F_HAS_DUAL_BANK, stm32l4_wrp::first, stm32l4_part_info::flags, stm32l4_wrp::last, LOG_ERROR, stm32l4_flash_bank::part_info, range_print_alloc(), set_bit(), STM32_ALL_BANKS, STM32_BANK1, STM32_BANK2, stm32l4_get_all_wrpxy(), stm32l4_is_otp(), and stm32l4_wrp::used.
FLASH_BANK_COMMAND_HANDLER | ( | stm32l4_flash_bank_command | ) |
Definition at line 592 of file stm32l4x.c.
References bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, stm32l4_flash_bank::otp_enabled, stm32l4_flash_bank::probed, STM32_FLASH_BANK_BASE, and stm32l4_flash_bank::user_bank_size.
|
static |
Definition at line 1681 of file stm32l4x.c.
References bank, stm32l4_flash_bank::dual_bank_mode, stm32l4_flash_bank::part_info, and stm32l4_is_otp().
Referenced by get_stm32l4_info().
|
static |
Definition at line 2066 of file stm32l4x.c.
References bank, cmd, command_print_sameline(), device_families, stm32l4_part_info::device_str, ERROR_OK, get_stm32l4_bank_type_str(), get_stm32l4_rev_str(), stm32l4_flash_bank::idcode, stm32l4_flash_bank::part_info, and stm32l4_flash_bank::probed.
|
static |
Definition at line 1667 of file stm32l4x.c.
References bank, stm32l4_flash_bank::idcode, stm32l4_part_info::num_revs, stm32l4_flash_bank::part_info, stm32l4_rev::rev, stm32l4_part_info::revs, and stm32l4_rev::str.
Referenced by get_stm32l4_info(), and stm32l4_probe().
|
static |
Definition at line 649 of file stm32l4x.c.
References range_print_one().
Referenced by COMMAND_HANDLER(), and stm32l4_protect_same_bank().
|
inlinestatic |
Definition at line 641 of file stm32l4x.c.
References range::end, and range::start.
Referenced by range_print_alloc().
|
static |
Definition at line 2037 of file stm32l4x.c.
References bank, ERROR_OK, F_HAS_L5_FLASH_REGS, stm32l4_part_info::flags, stm32l4_flash_bank::flash_regs_base, stm32l4_flash_bank::optr, stm32l4_flash_bank::part_info, stm32l4_flash_bank::probed, STM32_FLASH_OPTR_INDEX, stm32l4_probe(), stm32l4_read_flash_reg_by_index(), and STM32L5_REGS_SEC_OFFSET.
|
static |
Definition at line 1134 of file stm32l4x.c.
References bank, stm32l4_flash_bank::bank1_sectors, stm32l4_flash_bank::cr_bker_mask, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_ERASE_TIMEOUT, FLASH_LOCK, FLASH_PAGE_SHIFT, FLASH_PER, FLASH_SECBB_NON_SECURE, FLASH_SECBB_SECURE, FLASH_STRT, LOG_ERROR, stm32l4_flash_bank::rdp, RDP_LEVEL_0, STM32_FLASH_CR_INDEX, stm32l4_get_flash_cr_with_lock_index(), stm32l4_is_otp(), stm32l4_set_secbb(), stm32l4_unlock_reg(), stm32l4_wait_status_busy(), stm32l4_write_flash_reg_by_index(), TARGET_HALTED, and stm32l4_flash_bank::tzen.
|
static |
Definition at line 1032 of file stm32l4x.c.
References bank, stm32l4_flash_bank::bank1_sectors, stm32l4_flash_bank::dual_bank_mode, ERROR_OK, F_USE_ALL_WRPXX, stm32l4_part_info::flags, stm32l4_flash_bank::part_info, STM32_BANK1, STM32_BANK2, STM32_FLASH_WRP1AR_INDEX, STM32_FLASH_WRP1BR_INDEX, STM32_FLASH_WRP2AR_INDEX, STM32_FLASH_WRP2BR_INDEX, and stm32l4_get_one_wrpxy().
Referenced by COMMAND_HANDLER(), stm32l4_protect_check(), and stm32l4_protect_same_bank().
|
inlinestatic |
Definition at line 851 of file stm32l4x.c.
References bank, stm32l4_flash_bank::flash_regs, STM32_FLASH_CR_INDEX, and STM32_FLASH_CR_WLK_INDEX.
Referenced by stm32l4_erase(), stm32l4_mass_erase(), stm32l4_perform_obl_launch(), stm32l4_unlock_option_reg(), stm32l4_unlock_reg(), stm32l4_write(), and stm32l4_write_option().
|
inlinestatic |
Definition at line 732 of file stm32l4x.c.
References bank, and stm32l4_flash_bank::flash_regs_base.
Referenced by COMMAND_HANDLER(), stm32l4_get_flash_reg_by_index(), stm32l4_read_flash_reg(), and stm32l4_write_flash_reg().
|
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().
|
static |
Definition at line 1012 of file stm32l4x.c.
References bank, ERROR_OK, stm32l4_wrp::first, stm32l4_wrp::last, stm32l4_wrp::offset, offset, stm32l4_wrp::reg_idx, stm32l4_read_flash_reg_by_index(), stm32l4_wrp::used, stm32l4_wrp::value, and stm32l4_flash_bank::wrpxxr_mask.
Referenced by stm32l4_get_all_wrpxy().
|
inlinestatic |
Definition at line 672 of file stm32l4x.c.
References bank, stm32l4_part_info::otp_base, and stm32l4_flash_bank::part_info.
Referenced by COMMAND_HANDLER(), get_stm32l4_bank_type_str(), stm32l4_erase(), stm32l4_mass_erase(), stm32l4_otp_enable(), stm32l4_probe(), stm32l4_protect(), and stm32l4_write().
|
static |
Definition at line 2084 of file stm32l4x.c.
References bank, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, F_HAS_DUAL_BANK, stm32l4_part_info::flags, FLASH_ERASE_TIMEOUT, FLASH_LOCK, FLASH_MER1, FLASH_MER2, FLASH_SECBB_NON_SECURE, FLASH_SECBB_SECURE, FLASH_STRT, LOG_ERROR, stm32l4_flash_bank::part_info, stm32l4_flash_bank::rdp, RDP_LEVEL_0, target::state, STM32_FLASH_CR_INDEX, stm32l4_get_flash_cr_with_lock_index(), stm32l4_is_otp(), stm32l4_set_secbb(), stm32l4_unlock_reg(), stm32l4_wait_status_busy(), stm32l4_write_flash_reg_by_index(), TARGET_HALTED, and stm32l4_flash_bank::tzen.
Referenced by COMMAND_HANDLER().
|
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().
|
inlinestatic |
Definition at line 697 of file stm32l4x.c.
References bank, and stm32l4_flash_bank::otp_enabled.
Referenced by COMMAND_HANDLER(), and stm32l4_write().
|
static |
Definition at line 927 of file stm32l4x.c.
References bank, ERROR_OK, FLASH_LOCK, FLASH_OBL_LAUNCH, FLASH_OPTLOCK, stm32l4_flash_bank::probed, STM32_FLASH_CR_INDEX, stm32l4_get_flash_cr_with_lock_index(), stm32l4_unlock_option_reg(), stm32l4_unlock_reg(), and stm32l4_write_flash_reg_by_index().
Referenced by COMMAND_HANDLER().
|
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().
|
static |
Definition at line 1303 of file stm32l4x.c.
References bank, stm32l4_flash_bank::bank1_sectors, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, target::state, STM32_BANK1, STM32_BANK2, stm32l4_is_otp(), stm32l4_protect_check(), stm32l4_protect_same_bank(), and TARGET_HALTED.
|
static |
Definition at line 1110 of file stm32l4x.c.
References bank, ERROR_OK, stm32l4_wrp::first, stm32l4_wrp::last, STM32_ALL_BANKS, stm32l4_get_all_wrpxy(), and stm32l4_wrp::used.
Referenced by stm32l4_protect().
|
static |
Definition at line 1212 of file stm32l4x.c.
References bank, bitmap_to_ranges(), bitmap_zero(), clear_bit(), DECLARE_BITMAP, range::end, ERROR_FAIL, ERROR_OK, stm32l4_wrp::first, stm32l4_wrp::last, LOG_DEBUG, LOG_ERROR, LOG_INFO, stm32l4_wrp::offset, range_print_alloc(), set_bit(), range::start, stm32l4_get_all_wrpxy(), stm32l4_write_all_wrpxy(), and stm32l4_wrp::used.
Referenced by stm32l4_protect().
|
inlinestatic |
Definition at line 745 of file stm32l4x.c.
References bank, stm32l4_get_flash_reg(), and target_read_u32().
Referenced by COMMAND_HANDLER(), stm32l4_read_flash_reg_by_index(), and stm32l4_write_option().
|
inlinestatic |
Definition at line 750 of file stm32l4x.c.
References bank, stm32l4_flash_bank::flash_regs, and stm32l4_read_flash_reg().
Referenced by COMMAND_HANDLER(), stm32l4_auto_probe(), stm32l4_get_one_wrpxy(), stm32l4_probe(), stm32l4_unlock_option_reg(), stm32l4_unlock_reg(), stm32l4_wait_status_busy(), and stm32l4_write_block().
|
static |
Definition at line 1618 of file stm32l4x.c.
References adiv5_ap::ap_num, ARRAY_SIZE, bank, CORTEX_M0P_PARTNO, cortex_m_get_partno_safe(), DBGMCU_IDCODE_G0, DBGMCU_IDCODE_L4_G4, DBGMCU_IDCODE_L5, armv7m_common::debug_ap, DEVID_STM32WLE_WL5XX, ERROR_FAIL, ERROR_OK, ERROR_TARGET_INVALID, LOG_ERROR, target_read_u32(), target_to_armv7m_safe(), UID64_IDS, and UID64_IDS_STM32WL.
Referenced by stm32l4_probe().
|
static |
set all FLASH_SECBB registers to the same value
Definition at line 809 of file stm32l4x.c.
References ARRAY_SIZE, bank, stm32l4_flash_bank::dual_bank_mode, ERROR_OK, F_HAS_TZ, stm32l4_part_info::flags, FLASH_ERASE_TIMEOUT, FLASH_SECBB1, FLASH_SECBB2, LOG_DEBUG, stm32l4_flash_bank::part_info, stm32l4_wait_status_busy(), and stm32l4_write_flash_reg().
Referenced by stm32l4_erase(), stm32l4_mass_erase(), and stm32l4_write().
|
static |
Definition at line 703 of file stm32l4x.c.
References bank, F_HAS_TZ, stm32l4_part_info::flags, FLASH_RDP_MASK, FLASH_TZEN, stm32l4_flash_bank::optr, stm32l4_flash_bank::part_info, stm32l4_flash_bank::rdp, RDP_LEVEL_0, RDP_LEVEL_0_5, RDP_LEVEL_1, RDP_LEVEL_2, and stm32l4_flash_bank::tzen.
Referenced by COMMAND_HANDLER(), and stm32l4_probe().
|
static |
Definition at line 894 of file stm32l4x.c.
References bank, ctrl, ERROR_OK, ERROR_TARGET_FAILURE, FLASH_OPTLOCK, LOG_ERROR, OPTKEY1, OPTKEY2, STM32_FLASH_OPTKEYR_INDEX, stm32l4_get_flash_cr_with_lock_index(), stm32l4_read_flash_reg_by_index(), and stm32l4_write_flash_reg_by_index().
Referenced by stm32l4_perform_obl_launch(), and stm32l4_write_option().
|
static |
Definition at line 858 of file stm32l4x.c.
References bank, ctrl, ERROR_OK, ERROR_TARGET_FAILURE, FLASH_LOCK, KEY1, KEY2, LOG_ERROR, STM32_FLASH_KEYR_INDEX, stm32l4_get_flash_cr_with_lock_index(), stm32l4_read_flash_reg_by_index(), and stm32l4_write_flash_reg_by_index().
Referenced by stm32l4_erase(), stm32l4_mass_erase(), stm32l4_perform_obl_launch(), stm32l4_write(), and stm32l4_write_option().
|
static |
Definition at line 769 of file stm32l4x.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, FLASH_ERROR, FLASH_WRPERR, LOG_DEBUG, LOG_ERROR, stm32l4_flash_bank::sr_bsy_mask, status, STM32_FLASH_SR_INDEX, stm32l4_read_flash_reg_by_index(), and stm32l4_write_flash_reg_by_index().
Referenced by stm32l4_erase(), stm32l4_mass_erase(), stm32l4_set_secbb(), stm32l4_write_block_without_loader(), and stm32l4_write_option().
|
static |
Definition at line 1507 of file stm32l4x.c.
References bank, buffer, count, stm32l4_flash_bank::data_width, ERROR_FAIL, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FLASH_LOCK, FLASH_SECBB_NON_SECURE, FLASH_SECBB_SECURE, LOG_DEBUG, LOG_ERROR, LOG_WARNING, flash_sector::offset, offset, stm32l4_flash_bank::rdp, RDP_LEVEL_0, RDP_LEVEL_0_5, flash_sector::size, size, stm32l4_get_flash_cr_with_lock_index(), stm32l4_is_otp(), stm32l4_otp_is_enabled(), stm32l4_set_secbb(), stm32l4_unlock_reg(), stm32l4_write_block(), stm32l4_write_block_without_loader(), stm32l4_write_flash_reg_by_index(), TARGET_ADDR_FMT, TARGET_HALTED, and stm32l4_flash_bank::tzen.
|
static |
Definition at line 1097 of file stm32l4x.c.
References bank, ERROR_OK, and stm32l4_write_one_wrpxy().
Referenced by stm32l4_protect_same_bank().
|
static |
Definition at line 1338 of file stm32l4x.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, ARRAY_SIZE, bank, buf_set_u32(), buffer, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, count, stm32l4_flash_bank::data_width, destroy_reg_param(), ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FLASH_ERROR, FLASH_WRPERR, init_reg_param(), LDR_STACK_SIZE, LOG_ERROR, LOG_WARNING, NULL, offset, PARAM_IN_OUT, PARAM_OUT, source, stm32l4_flash_bank::sr_bsy_mask, stm32l4_work_area::stack, STM32_FLASH_CR_INDEX, STM32_FLASH_SR_INDEX, stm32l4_get_flash_reg_by_index(), stm32l4_read_flash_reg_by_index(), stm32l4_write_flash_reg_by_index(), target_alloc_working_area(), target_alloc_working_area_try(), target_buffer_set_u32(), target_free_working_area(), target_get_working_area_avail(), target_run_flash_async_algorithm(), and target_write_buffer().
Referenced by stm32l4_write().
|
static |
Definition at line 1463 of file stm32l4x.c.
References bank, buffer, count, stm32l4_flash_bank::data_width, ERROR_OK, FLASH_PG, FLASH_WRITE_TIMEOUT, offset, STM32_FLASH_CR_INDEX, stm32l4_wait_status_busy(), stm32l4_write_flash_reg_by_index(), and target_write_memory().
Referenced by stm32l4_write().
|
inlinestatic |
Definition at line 757 of file stm32l4x.c.
References bank, stm32l4_get_flash_reg(), and target_write_u32().
Referenced by stm32l4_set_secbb(), stm32l4_write_flash_reg_by_index(), and stm32l4_write_option().
|
inlinestatic |
Definition at line 762 of file stm32l4x.c.
References bank, stm32l4_flash_bank::flash_regs, and stm32l4_write_flash_reg().
Referenced by stm32l4_erase(), stm32l4_mass_erase(), stm32l4_perform_obl_launch(), stm32l4_unlock_option_reg(), stm32l4_unlock_reg(), stm32l4_wait_status_busy(), stm32l4_write(), stm32l4_write_block(), stm32l4_write_block_without_loader(), and stm32l4_write_option().
|
static |
Definition at line 1085 of file stm32l4x.c.
References bank, stm32l4_wrp::first, stm32l4_flash_bank::flash_regs, stm32l4_wrp::last, stm32l4_wrp::offset, stm32l4_wrp::reg_idx, stm32l4_write_option(), and stm32l4_flash_bank::wrpxxr_mask.
Referenced by stm32l4_write_all_wrpxy().
|
static |
Definition at line 964 of file stm32l4x.c.
References bank, ERROR_OK, F_HAS_L5_FLASH_REGS, stm32l4_part_info::flags, FLASH_ERASE_TIMEOUT, FLASH_LOCK, FLASH_OPTLOCK, FLASH_OPTSTRT, stm32l4_flash_bank::flash_regs, mask, stm32l4_flash_bank::part_info, STM32_FLASH_CR_INDEX, stm32l4_get_flash_cr_with_lock_index(), stm32l4_read_flash_reg(), stm32l4_unlock_option_reg(), stm32l4_unlock_reg(), stm32l4_wait_status_busy(), stm32l4_write_flash_reg(), stm32l4_write_flash_reg_by_index(), and stm32l5_ns_flash_regs.
Referenced by COMMAND_HANDLER(), and stm32l4_write_one_wrpxy().
|
static |
Definition at line 266 of file stm32l4x.c.
Referenced by get_stm32l4_info(), and stm32l4_probe().
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 2452 of file stm32l4x.c.
|
static |
Definition at line 2452 of file stm32l4x.c.
|
static |
Definition at line 161 of file stm32l4x.c.
Referenced by stm32l4_probe().
|
static |
Definition at line 266 of file stm32l4x.c.
Referenced by stm32l4_probe().
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
const struct flash_driver stm32l4x_flash |
Definition at line 2452 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 186 of file stm32l4x.c.
Referenced by stm32l4_probe(), and stm32l4_write_option().
|
static |
Definition at line 199 of file stm32l4x.c.
Referenced by stm32l4_probe().
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 266 of file stm32l4x.c.
|
static |
Definition at line 174 of file stm32l4x.c.
Referenced by stm32l4_probe().
|
static |
Definition at line 266 of file stm32l4x.c.