OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | stm32lx_flash_bank |
struct | stm32lx_part_info |
struct | stm32lx_rev |
Macros | |
#define | DBGMCU_IDCODE 0xE0042000 |
#define | DBGMCU_IDCODE_L0 0x40015800 |
#define | FLASH_ACR 0x00 |
#define | FLASH_ACR__ACC64 (1<<2) |
#define | FLASH_ACR__LATENCY (1<<0) |
#define | FLASH_ACR__PRFTEN (1<<1) |
#define | FLASH_ACR__RUN_PD (1<<4) |
#define | FLASH_ACR__SLEEP_PD (1<<3) |
#define | FLASH_BANK0_ADDRESS 0x08000000 |
#define | FLASH_OBR 0x1C |
#define | FLASH_OPTKEYR 0x14 |
#define | FLASH_PDKEYR 0x08 |
#define | FLASH_PECR 0x04 |
#define | FLASH_PECR__DATA (1<<4) |
#define | FLASH_PECR__EOPIE (1<<16) |
#define | FLASH_PECR__ERASE (1<<9) |
#define | FLASH_PECR__ERRIE (1<<17) |
#define | FLASH_PECR__FPRG (1<<10) |
#define | FLASH_PECR__FTDW (1<<8) |
#define | FLASH_PECR__OBL_LAUNCH (1<<18) |
#define | FLASH_PECR__OPTLOCK (1<<2) |
#define | FLASH_PECR__PELOCK (1<<0) |
#define | FLASH_PECR__PRGLOCK (1<<1) |
#define | FLASH_PECR__PROG (1<<3) |
#define | FLASH_PEKEYR 0x0C |
#define | FLASH_PRGKEYR 0x10 |
#define | FLASH_SECTOR_SIZE 4096 |
#define | FLASH_SR 0x18 |
#define | FLASH_SR__BSY (1<<0) |
#define | FLASH_SR__ENDHV (1<<2) |
#define | FLASH_SR__EOP (1<<1) |
#define | FLASH_SR__OPTVERR (1<<11) |
#define | FLASH_SR__PGAERR (1<<9) |
#define | FLASH_SR__READY (1<<3) |
#define | FLASH_SR__SIZERR (1<<10) |
#define | FLASH_SR__WRPERR (1<<8) |
#define | FLASH_WRPR 0x20 |
#define | OPTION_BYTE_0_PR0 0xFF5500AA |
#define | OPTION_BYTE_0_PR1 0xFFFF0000 |
#define | OPTION_BYTES_ADDRESS 0x1FF80000 |
#define | OPTKEY1 0xFBEAD9C8 |
#define | OPTKEY2 0x24252627 |
#define | PEKEY1 0x89ABCDEF |
#define | PEKEY2 0x02030405 |
#define | PRGKEY1 0x8C9DAEBF |
#define | PRGKEY2 0x13141516 |
Variables | |
static const struct stm32lx_rev | stm32_416_revs [] |
static const struct stm32lx_rev | stm32_417_revs [] |
static const struct stm32lx_rev | stm32_425_revs [] |
static const struct stm32lx_rev | stm32_427_revs [] |
static const struct stm32lx_rev | stm32_429_revs [] |
static const struct stm32lx_rev | stm32_436_revs [] |
static const struct stm32lx_rev | stm32_437_revs [] |
static const struct stm32lx_rev | stm32_447_revs [] |
static const struct stm32lx_rev | stm32_457_revs [] |
static const struct command_registration | stm32lx_command_handlers [] |
static const struct command_registration | stm32lx_exec_command_handlers [] |
const struct flash_driver | stm32lx_flash |
static const struct stm32lx_part_info | stm32lx_parts [] |
COMMAND_HANDLER | ( | stm32lx_handle_lock_command | ) |
Definition at line 317 of file stm32lx.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stm32lx_lock().
COMMAND_HANDLER | ( | stm32lx_handle_mass_erase_command | ) |
Definition at line 298 of file stm32lx.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stm32lx_mass_erase().
COMMAND_HANDLER | ( | stm32lx_handle_unlock_command | ) |
Definition at line 337 of file stm32lx.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stm32lx_unlock().
FLASH_BANK_COMMAND_HANDLER | ( | stm32lx_flash_bank_command | ) |
Definition at line 272 of file stm32lx.c.
References bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, LOG_ERROR, stm32lx_flash_bank::probed, and stm32lx_flash_bank::user_bank_size.
|
static |
Definition at line 863 of file stm32lx.c.
References bank, ERROR_OK, stm32lx_flash_bank::probed, and stm32lx_probe().
|
static |
Unlock the program memory, then set the FPRG bit in the PECR register.
Definition at line 1020 of file stm32lx.c.
References bank, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_PECR, FLASH_PECR__FPRG, FLASH_PECR__PROG, stm32lx_unlock_program_memory(), target_read_u32(), and target_write_u32().
Referenced by stm32lx_write_half_pages().
|
static |
Definition at line 383 of file stm32lx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, stm32lx_erase_sector(), and TARGET_HALTED.
|
static |
Definition at line 1091 of file stm32lx.c.
References addr, bank, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_PECR, FLASH_PECR__ERASE, FLASH_PECR__PROG, stm32lx_part_info::page_size, stm32lx_part_info::pages_per_sector, stm32lx_flash_bank::part_info, stm32lx_lock_program_memory(), stm32lx_unlock_program_memory(), stm32lx_wait_until_bsy_clear(), and target_write_u32().
Referenced by stm32lx_erase().
|
inlinestatic |
Definition at line 1138 of file stm32lx.c.
References bank, stm32lx_flash_bank::flash_base, FLASH_SR, status, and target_read_u32().
Referenced by stm32lx_wait_until_bsy_clear_timeout().
|
static |
|
static |
Definition at line 1257 of file stm32lx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, OPTION_BYTE_0_PR1, OPTION_BYTES_ADDRESS, target::state, stm32lx_unlock_options_bytes(), TARGET_HALTED, and target_write_u32().
Referenced by COMMAND_HANDLER(), and stm32lx_mass_erase().
|
static |
Definition at line 1057 of file stm32lx.c.
References bank, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_PECR, FLASH_PECR__PELOCK, FLASH_PECR__PRGLOCK, target_read_u32(), and target_write_u32().
Referenced by stm32lx_erase_sector(), stm32lx_write(), and stm32lx_write_half_pages().
|
static |
Definition at line 1305 of file stm32lx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, stm32lx_flash_bank::flash_base, FLASH_PECR, FLASH_PECR__OPTLOCK, LOG_ERROR, NULL, target::state, stm32lx_lock(), stm32lx_obl_launch(), stm32lx_unlock(), TARGET_HALTED, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1237 of file stm32lx.c.
References bank, ERROR_FAIL, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_PECR, FLASH_PECR__OBL_LAUNCH, target::state, target_halt(), TARGET_HALTED, target_poll(), and target_write_u32().
Referenced by stm32lx_mass_erase().
|
static |
Definition at line 730 of file stm32lx.c.
References ARRAY_SIZE, bank, stm32lx_part_info::device_str, ERROR_FAIL, ERROR_OK, stm32lx_part_info::first_bank_size_kb, FLASH_BANK0_ADDRESS, stm32lx_part_info::flash_base, stm32lx_flash_bank::flash_base, FLASH_SECTOR_SIZE, stm32lx_part_info::fsize_base, stm32lx_part_info::has_dual_banks, stm32lx_part_info::id, stm32lx_flash_bank::idcode, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, stm32lx_part_info::max_flash_size_kb, stm32lx_flash_bank::part_info, stm32lx_flash_bank::probed, stm32lx_parts, stm32lx_read_id_code(), stm32lx_update_part_info(), TARGET_ADDR_FMT, target_read_u16(), and stm32lx_flash_bank::user_bank_size.
Referenced by stm32lx_auto_probe().
|
static |
Definition at line 357 of file stm32lx.c.
References bank, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_WRPR, and target_read_u32().
|
static |
Definition at line 718 of file stm32lx.c.
References arm::arch, armv7m_common::arm, ARM_ARCH_V6M, DBGMCU_IDCODE, DBGMCU_IDCODE_L0, target_read_u32(), and target_to_armv7m().
Referenced by stm32lx_probe().
|
static |
Definition at line 1279 of file stm32lx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, OPTION_BYTE_0_PR0, OPTION_BYTES_ADDRESS, target::state, stm32lx_unlock_options_bytes(), stm32lx_wait_until_bsy_clear_timeout(), TARGET_HALTED, and target_write_u32().
Referenced by COMMAND_HANDLER(), and stm32lx_mass_erase().
|
static |
Definition at line 1151 of file stm32lx.c.
References bank, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_OPTKEYR, FLASH_PECR, FLASH_PECR__OPTLOCK, FLASH_PECR__PELOCK, FLASH_PEKEYR, OPTKEY1, OPTKEY2, PEKEY1, PEKEY2, target_read_u32(), and target_write_u32().
Referenced by stm32lx_lock(), and stm32lx_unlock().
|
static |
Definition at line 954 of file stm32lx.c.
References bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_PECR, FLASH_PECR__PELOCK, FLASH_PECR__PRGLOCK, FLASH_PEKEYR, FLASH_PRGKEYR, LOG_ERROR, PEKEY1, PEKEY2, PRGKEY1, PRGKEY2, target_read_u32(), and target_write_u32().
Referenced by stm32lx_enable_write_half_page(), stm32lx_erase_sector(), and stm32lx_write().
|
static |
Definition at line 1346 of file stm32lx.c.
References bank, ERROR_OK, stm32lx_part_info::first_bank_size_kb, stm32lx_part_info::has_dual_banks, stm32lx_part_info::id, and stm32lx_flash_bank::part_info.
Referenced by stm32lx_probe().
|
static |
Definition at line 1146 of file stm32lx.c.
References bank, and stm32lx_wait_until_bsy_clear_timeout().
Referenced by stm32lx_erase_sector(), stm32lx_write(), and stm32lx_write_half_pages().
|
static |
Definition at line 1194 of file stm32lx.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, stm32lx_flash_bank::flash_base, FLASH_SR, FLASH_SR__BSY, FLASH_SR__OPTVERR, FLASH_SR__PGAERR, FLASH_SR__WRPERR, LOG_DEBUG, LOG_ERROR, status, stm32lx_get_flash_status(), and target_write_u32().
Referenced by stm32lx_unlock(), and stm32lx_wait_until_bsy_clear().
|
static |
Definition at line 606 of file stm32lx.c.
References bank, buffer, count, ERROR_FAIL, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_ERROR, LOG_WARNING, MIN, offset, stm32lx_part_info::page_size, stm32lx_flash_bank::part_info, stm32lx_lock_program_memory(), stm32lx_unlock_program_memory(), stm32lx_wait_until_bsy_clear(), stm32lx_write_half_pages(), TARGET_HALTED, and target_write_buffer().
|
static |
Definition at line 410 of file stm32lx.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, armv7m_common::demcr, destroy_reg_param(), ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, armv7m_common::exception_number, stm32lx_flash_bank::flash_base, init_reg_param(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, NULL, offset, stm32lx_part_info::page_size, PARAM_OUT, stm32lx_flash_bank::part_info, source, stm32lx_enable_write_half_page(), stm32lx_lock_program_memory(), stm32lx_wait_until_bsy_clear(), target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), target_run_algorithm(), target_to_armv7m(), target_write_buffer(), and VC_HARDERR.
Referenced by stm32lx_write().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const struct flash_driver stm32lx_flash |
|
static |
Definition at line 97 of file stm32lx.c.
Referenced by stm32lx_probe().