OpenOCD
|
Go to the source code of this file.
Macros | |
#define | FLASH_ERASE_TIMEOUT 500 |
#define | FLASH_MASS_ERASE_TIMEOUT 2400 |
#define | FLASH_WRITE_TIMEOUT 5 |
#define | HICK_STABLE_TIMEOUT 1000 |
Functions | |
static int | artery_auto_probe (struct flash_bank *bank) |
static int | artery_deinit_flash (struct flash_bank *bank) |
static int | artery_disable_fap (struct flash_bank *bank) |
static int | artery_enable_hiclk (struct flash_bank *bank) |
static int | artery_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | artery_get_fap (struct flash_bank *bank, enum artery_fap_level *fap_level) |
static int | artery_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | artery_init_flash (struct flash_bank *bank) |
static int | artery_mass_erase (struct flash_bank *bank) |
static int | artery_probe (struct flash_bank *bank) |
static int | artery_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | artery_protect_check (struct flash_bank *bank) |
static int | artery_read_flash_register (struct flash_bank *bank, enum artery_flash_reg_index reg, uint32_t *value) |
static int | artery_read_protection (struct flash_bank *bank, uint64_t *protection) |
static int | artery_usd_erase (struct flash_bank *bank) |
static int | artery_usd_init (struct flash_bank *bank, uint8_t **buffer) |
static int | artery_usd_load (const struct artery_part_info *part_info, const uint8_t *buffer, struct artery_usd *usd) |
static int | artery_usd_lock (struct flash_bank *bank) |
static int | artery_usd_read (struct flash_bank *bank, uint8_t *buffer) |
static uint8_t | artery_usd_read_buffer (const uint8_t *buffer, uint32_t base, uint32_t offset) |
static int | artery_usd_unlock (struct flash_bank *bank) |
static void | artery_usd_update (const struct artery_part_info *part_info, uint8_t *buffer, const struct artery_usd *usd) |
static int | artery_usd_write (struct flash_bank *bank, const uint8_t *buffer) |
static void | artery_usd_write_buffer (uint8_t *buffer, uint32_t base, uint32_t offset, uint8_t data) |
static int | artery_wait_flash_busy (struct flash_bank *bank, unsigned int timeout) |
static int | artery_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | artery_write_flash_register (struct flash_bank *bank, enum artery_flash_reg_index reg, uint32_t value) |
static int | artery_write_without_loader (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
COMMAND_HANDLER (artery_handle_fap_disable_command) | |
COMMAND_HANDLER (artery_handle_fap_enable_command) | |
COMMAND_HANDLER (artery_handle_fap_state_command) | |
COMMAND_HANDLER (artery_handle_mass_erase_command) | |
FLASH_BANK_COMMAND_HANDLER (artery_flash_bank_command) | |
Variables | |
static const struct command_registration | artery_command_handlers [] |
static const struct command_registration | artery_exec_command_handlers [] |
static const struct command_registration | artery_fap_command_handlers [] |
const struct flash_driver | artery_flash |
static const struct artery_part_info | artery_parts [] |
static const struct artery_series_info | artery_series [] |
static const uint32_t | flash_regs_f435_f437 [ARTERY_FLASH_REG_INDEX_NUM] |
static const uint32_t | flash_regs_f4xx_wb415 [ARTERY_FLASH_REG_INDEX_NUM] |
static const uint32_t | usd_offsets_f403a_f407_f413 [ARTERY_USD_INDEX_NUM] |
static const uint32_t | usd_offsets_f435_f437 [ARTERY_USD_INDEX_NUM] |
static const uint32_t | usd_offsets_f4xx_wb415 [ARTERY_USD_INDEX_NUM] |
|
static |
Definition at line 2206 of file artery.c.
References artery_info(), artery_probe(), bank, and ERROR_OK.
|
static |
Definition at line 1372 of file artery.c.
References ARTERY_FLASH_REG_CTRL, artery_read_flash_register(), artery_usd_lock(), artery_write_flash_register(), bank, ctrl, ERROR_FAIL, ERROR_OK, FLASH_CTRL_OPLK, and LOG_ERROR.
Referenced by artery_disable_fap(), artery_erase(), artery_mass_erase(), artery_protect(), artery_write(), and COMMAND_HANDLER().
|
static |
Definition at line 2381 of file artery.c.
References artery_deinit_flash(), ARTERY_FAP_LEVEL_DISABLED, ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_STS, artery_info(), artery_init_flash(), artery_usd_erase(), ARTERY_USD_FAP_INDEX, artery_usd_write_buffer(), artery_wait_flash_busy(), artery_write_flash_register(), bank, buffer, ctrl, ERROR_OK, FLASH_CTRL_USDPRGM, FLASH_CTRL_USDULKS, FLASH_STS_PRGMERR, FLASH_WRITE_TIMEOUT, LOG_ERROR, artery_part_info::series, and target_write_u16().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1214 of file artery.c.
References artery_info(), bank, artery_series_info::crm_base, CRM_CTRL_HICKEN, CRM_CTRL_HICKSTBL, CRM_REG_CTRL, ERROR_FAIL, ERROR_OK, HICK_STABLE_TIMEOUT, keep_alive(), LOG_ERROR, artery_part_info::series, target_read_u32(), target_write_u32(), and timeval_ms().
Referenced by artery_init_flash().
|
static |
Definition at line 1455 of file artery.c.
References artery_deinit_flash(), ARTERY_FLASH_REG_ADDR, ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_STS, artery_init_flash(), artery_read_flash_register(), artery_wait_flash_busy(), artery_write_flash_register(), bank, ERROR_FLASH_PROTECTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_CTRL_ERSTR, FLASH_CTRL_SECERS, FLASH_ERASE_TIMEOUT, FLASH_STS_EPPERR, FLASH_WRITE_TIMEOUT, LOG_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 1774 of file artery.c.
References ARTERY_FAP_LEVEL_DISABLED, ARTERY_FAP_LEVEL_HIGH, ARTERY_FAP_LEVEL_LOW, ARTERY_FLASH_REG_USD, artery_info(), artery_read_flash_register(), bank, ERROR_OK, FLASH_USD_FAP, FLASH_USD_FAP_HL, artery_series_info::has_fap_high_level, and artery_part_info::series.
Referenced by artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 2216 of file artery.c.
References bank, cmd, command_print_sameline(), ERROR_OK, artery_part_info::flash_size, and artery_part_info::name.
Referenced by artery_auto_probe(), artery_disable_fap(), artery_enable_hiclk(), artery_get_fap(), artery_probe(), artery_protect(), artery_read_flash_register(), artery_read_protection(), artery_usd_init(), artery_usd_read(), artery_usd_write(), artery_write_flash_register(), COMMAND_HANDLER(), and FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 1326 of file artery.c.
References artery_enable_hiclk(), ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_UNLOCK, artery_read_flash_register(), artery_usd_unlock(), artery_write_flash_register(), bank, ctrl, ERROR_FAIL, ERROR_OK, FLASH_CTRL_OPLK, KEY1, KEY2, and LOG_ERROR.
Referenced by artery_disable_fap(), artery_erase(), artery_mass_erase(), artery_protect(), artery_write(), and COMMAND_HANDLER().
|
static |
Definition at line 2232 of file artery.c.
References artery_deinit_flash(), ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_STS, artery_init_flash(), artery_read_flash_register(), artery_wait_flash_busy(), artery_write_flash_register(), bank, ctrl, ERROR_OK, FLASH_CTRL_BANKERS, FLASH_CTRL_ERSTR, FLASH_MASS_ERASE_TIMEOUT, FLASH_STS_EPPERR, FLASH_WRITE_TIMEOUT, and LOG_ERROR.
|
static |
Definition at line 1980 of file artery.c.
References cortex_m_common::armv7m, ARRAY_SIZE, artery_info(), artery_parts, ARTERY_SERIES_F403A_F407, ARTERY_SERIES_F413, ARTERY_SERIES_F415, ARTERY_SERIES_F421, ARTERY_SERIES_F423, ARTERY_SERIES_F425, ARTERY_SERIES_F435_F437, ARTERY_SERIES_WB415, bank, DEBUG_IDCODE, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, ERROR_TARGET_INVALID, ERROR_TARGET_NOT_EXAMINED, FLASH_BASE, artery_part_info::flash_size, armv7m_common::fp_feature, FP_NONE, LOG_ERROR, LOG_INFO, MIN, artery_part_info::name, NULL, artery_part_info::page_size, artery_part_info::series, target_read_u32(), target_to_cortex_m_safe(), and target_was_examined().
Referenced by artery_auto_probe().
|
static |
Definition at line 1801 of file artery.c.
References artery_deinit_flash(), ARTERY_FAP_LEVEL_DISABLED, artery_get_fap(), artery_info(), artery_init_flash(), artery_usd_erase(), artery_usd_init(), artery_usd_load(), artery_usd_read(), artery_usd_update(), artery_usd_write(), bank, BIT, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, MIN, artery_usd::protection, artery_usd::protection_ext, target::state, and TARGET_HALTED.
|
static |
|
static |
Definition at line 1166 of file artery.c.
References artery_info(), bank, artery_series_info::flash_regs, artery_series_info::flash_regs_base, artery_part_info::series, and target_read_u32().
Referenced by artery_deinit_flash(), artery_erase(), artery_get_fap(), artery_init_flash(), artery_mass_erase(), artery_read_protection(), artery_usd_erase(), artery_usd_lock(), artery_usd_unlock(), artery_usd_write(), and artery_wait_flash_busy().
|
static |
Definition at line 1407 of file artery.c.
References ARTERY_FLASH_REG_EPPS0, ARTERY_FLASH_REG_EPPS1, artery_info(), artery_read_flash_register(), bank, ERROR_OK, protection, and artery_part_info::series.
Referenced by artery_protect_check().
|
static |
Definition at line 1735 of file artery.c.
References ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_STS, artery_read_flash_register(), artery_wait_flash_busy(), artery_write_flash_register(), bank, ctrl, ERROR_OK, FLASH_CTRL_ERSTR, FLASH_CTRL_USDERS, FLASH_CTRL_USDULKS, FLASH_WRITE_TIMEOUT, and LOG_ERROR.
Referenced by artery_disable_fap(), artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 1533 of file artery.c.
References artery_info(), bank, buffer, ERROR_FAIL, ERROR_OK, LOG_ERROR, and artery_part_info::usd_size.
Referenced by artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 1567 of file artery.c.
References ARTERY_FAP_LEVEL_DISABLED, ARTERY_FAP_LEVEL_HIGH, ARTERY_FAP_LEVEL_LOW, ARTERY_USD_DATA_EXT_INDEX, ARTERY_USD_DATA_INDEX, ARTERY_USD_EPP_INDEX, ARTERY_USD_FAP_INDEX, artery_usd_read_buffer(), ARTERY_USD_SSB_INDEX, buffer, artery_usd::data, ERROR_OK, artery_usd::fap_level, artery_usd::protection, artery_usd::protection_ext, artery_part_info::series, artery_usd::ssb, and artery_part_info::usd_data_size.
Referenced by artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 1294 of file artery.c.
References ARTERY_FLASH_REG_CTRL, artery_read_flash_register(), artery_write_flash_register(), bank, ctrl, ERROR_FAIL, ERROR_OK, FLASH_CTRL_USDULKS, and LOG_ERROR.
Referenced by artery_deinit_flash().
|
static |
Definition at line 1551 of file artery.c.
References artery_info(), bank, buffer, artery_part_info::series, target_read_buffer(), artery_series_info::usd_base, and artery_part_info::usd_size.
Referenced by artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 1561 of file artery.c.
References buffer, and offset.
Referenced by artery_usd_load().
|
static |
Definition at line 1260 of file artery.c.
References ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_USD_UNLOCK, artery_read_flash_register(), artery_write_flash_register(), bank, ctrl, ERROR_FAIL, ERROR_OK, FLASH_CTRL_USDULKS, KEY1, KEY2, and LOG_ERROR.
Referenced by artery_init_flash().
|
static |
Definition at line 1624 of file artery.c.
References ARTERY_USD_DATA_EXT_INDEX, ARTERY_USD_DATA_INDEX, ARTERY_USD_EPP_EXT_INDEX, ARTERY_USD_EPP_INDEX, ARTERY_USD_FAP_INDEX, ARTERY_USD_SSB_INDEX, artery_usd_write_buffer(), buffer, artery_usd::data, artery_usd::fap_level, artery_usd::protection, artery_usd::protection_ext, artery_part_info::series, artery_usd::ssb, and artery_part_info::usd_data_size.
Referenced by artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 1658 of file artery.c.
References ARTERY_FLASH_REG_CTRL, ARTERY_FLASH_REG_STS, artery_info(), artery_read_flash_register(), artery_wait_flash_busy(), artery_write_flash_register(), bank, buffer, ctrl, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FLASH_CTRL_USDPRGM, FLASH_CTRL_USDULKS, FLASH_STS_PRGMERR, FLASH_WRITE_TIMEOUT, LOG_ERROR, artery_part_info::series, target_write_u32(), and artery_part_info::usd_size.
Referenced by artery_protect(), and COMMAND_HANDLER().
|
static |
Definition at line 1617 of file artery.c.
References buffer, and offset.
Referenced by artery_disable_fap(), and artery_usd_update().
|
static |
Definition at line 1188 of file artery.c.
References ARTERY_FLASH_REG_STS, artery_read_flash_register(), bank, ERROR_FAIL, ERROR_OK, FLASH_STS_OBF, keep_alive(), LOG_ERROR, status, and timeval_ms().
Referenced by artery_disable_fap(), artery_erase(), artery_mass_erase(), artery_usd_erase(), artery_usd_write(), and artery_write_without_loader().
|
static |
Definition at line 1947 of file artery.c.
References artery_deinit_flash(), artery_init_flash(), artery_write_without_loader(), bank, buffer, count, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, offset, target::state, and TARGET_HALTED.
|
static |
Definition at line 1177 of file artery.c.
References artery_info(), bank, artery_series_info::flash_regs, artery_series_info::flash_regs_base, artery_part_info::series, and target_write_u32().
Referenced by artery_deinit_flash(), artery_disable_fap(), artery_erase(), artery_init_flash(), artery_mass_erase(), artery_usd_erase(), artery_usd_lock(), artery_usd_unlock(), artery_usd_write(), and artery_write_without_loader().
|
static |
Definition at line 1905 of file artery.c.
References address, ARTERY_FLASH_REG_CTRL, artery_wait_flash_busy(), artery_write_flash_register(), bank, buffer, count, ERROR_OK, FLASH_CTRL_FPRGM, FLASH_WRITE_TIMEOUT, LOG_ERROR, offset, and target_write_memory().
Referenced by artery_write().
COMMAND_HANDLER | ( | artery_handle_fap_disable_command | ) |
Definition at line 2459 of file artery.c.
References artery_disable_fap(), ARTERY_FAP_LEVEL_DISABLED, artery_get_fap(), bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, and ERROR_OK.
COMMAND_HANDLER | ( | artery_handle_fap_enable_command | ) |
Definition at line 2291 of file artery.c.
References artery_deinit_flash(), ARTERY_FAP_LEVEL_DISABLED, ARTERY_FAP_LEVEL_LOW, artery_get_fap(), artery_info(), artery_init_flash(), artery_usd_erase(), artery_usd_init(), artery_usd_load(), artery_usd_read(), artery_usd_update(), artery_usd_write(), bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, artery_usd::fap_level, and LOG_ERROR.
COMMAND_HANDLER | ( | artery_handle_fap_state_command | ) |
Definition at line 2493 of file artery.c.
References ARTERY_FAP_LEVEL_DISABLED, artery_get_fap(), bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
FLASH_BANK_COMMAND_HANDLER | ( | artery_flash_bank_command | ) |
Definition at line 1149 of file artery.c.
References artery_info(), bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, and ERROR_OK.
|
static |
|
static |
|
static |
const struct flash_driver artery_flash |
|
static |
Definition at line 89 of file artery.c.
Referenced by artery_probe().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |