OpenOCD
|
flash programming support for NXP LPC8xx,LPC1xxx,LPC4xxx,LP5410x,LPC2xxx and NHS31xx devices. More...
Go to the source code of this file.
Data Structures | |
struct | lpc2000_flash_bank |
Macros | |
#define | IAP_CODE_LEN 0x34 |
#define | LPC1110_1 0x0A07102B |
#define | LPC1110_2 0x1A07102B |
#define | LPC1111_002_1 0x0A16D02B |
#define | LPC1111_002_2 0x1A16D02B |
#define | LPC1111_101_1 0x041E502B |
#define | LPC1111_101_2 0x2516D02B |
#define | LPC1111_103_1 0x00010013 |
#define | LPC1111_201_1 0x0416502B |
#define | LPC1111_201_2 0x2516902B |
#define | LPC1111_203_1 0x00010012 |
#define | LPC1112_101_1 0x042D502B |
#define | LPC1112_101_2 0x2524D02B |
#define | LPC1112_102_1 0x0A24902B |
#define | LPC1112_102_2 0x1A24902B |
#define | LPC1112_103_1 0x00020023 |
#define | LPC1112_201_1 0x0425502B |
#define | LPC1112_201_2 0x2524902B |
#define | LPC1112_203_1 0x00020022 |
#define | LPC1113_201_1 0x0434502B |
#define | LPC1113_201_2 0x2532902B |
#define | LPC1113_203_1 0x00030032 |
#define | LPC1113_301_1 0x0434102B |
#define | LPC1113_301_2 0x2532102B |
#define | LPC1113_303_1 0x00030030 |
#define | LPC1114_102_1 0x0A40902B |
#define | LPC1114_102_2 0x1A40902B |
#define | LPC1114_201_1 0x0444502B |
#define | LPC1114_201_2 0x2540902B |
#define | LPC1114_203_1 0x00040042 |
#define | LPC1114_301_1 0x0444102B |
#define | LPC1114_301_2 0x2540102B |
#define | LPC1114_303_1 0x00040040 |
#define | LPC1114_323_1 0x00040060 |
#define | LPC1114_333_1 0x00040070 |
#define | LPC1115_303_1 0x00050080 |
#define | LPC11A02_1 0x4D4C802B |
#define | LPC11A04_1 0x4D80002B |
#define | LPC11A11_001_1 0x455EC02B |
#define | LPC11A12_101_1 0x4574802B |
#define | LPC11A13_201_1 0x458A402B |
#define | LPC11A14_301_1 0x35A0002B |
#define | LPC11A14_301_2 0x45A0002B |
#define | LPC11C12_301_1 0x1421102B |
#define | LPC11C14_301_1 0x1440102B |
#define | LPC11C22_301_1 0x1431102B |
#define | LPC11C24_301_1 0x1430102B |
#define | LPC11E11_101 0x293E902B |
#define | LPC11E12_201 0x2954502B |
#define | LPC11E13_301 0x296A102B |
#define | LPC11E14_401 0x2980102B |
#define | LPC11E36_501 0x00009C41 |
#define | LPC11E37_401 0x00007C45 |
#define | LPC11E37_501 0x00007C41 |
#define | LPC11E66 0x0000DCC1 |
#define | LPC11E67 0x0000BC81 |
#define | LPC11E68 0x00007C01 |
#define | LPC11U12_201_1 0x095C802B |
#define | LPC11U12_201_2 0x295C802B |
#define | LPC11U13_201_1 0x097A802B |
#define | LPC11U13_201_2 0x297A802B |
#define | LPC11U14_201_1 0x0998802B |
#define | LPC11U14_201_2 0x2998802B |
#define | LPC11U23_301 0x2972402B |
#define | LPC11U24_301 0x2988402B |
#define | LPC11U24_401 0x2980002B |
#define | LPC11U34_311 0x0003D440 |
#define | LPC11U34_421 0x0001CC40 |
#define | LPC11U35_401 0x0001BC40 |
#define | LPC11U35_501 0x0000BC40 |
#define | LPC11U36_401 0x00019C40 |
#define | LPC11U37_401 0x00017C40 |
#define | LPC11U37_501 0x00007C40 |
#define | LPC11U37H_401 0x00007C44 |
#define | LPC11U66 0x0000DCC8 |
#define | LPC11U67_1 0x0000BC88 |
#define | LPC11U67_2 0x0000BC80 |
#define | LPC11U68_1 0x00007C08 |
#define | LPC11U68_2 0x00007C00 |
#define | LPC11XX_REG_SECTORS 24 |
#define | LPC1311 0x2C42502B |
#define | LPC1311_1 0x1816902B |
#define | LPC1313 0x2C40102B |
#define | LPC1313_1 0x1830102B |
#define | LPC1315 0x3A010523 |
#define | LPC1316 0x1A018524 |
#define | LPC1317 0x1A020525 |
#define | LPC1342 0x3D01402B |
#define | LPC1343 0x3D00002B |
#define | LPC1343_1 0x3000002B |
#define | LPC1345 0x28010541 |
#define | LPC1346 0x08018542 |
#define | LPC1347 0x08020543 |
#define | LPC1751_1 0x25001110 |
#define | LPC1751_2 0x25001118 |
#define | LPC1752 0x25001121 |
#define | LPC1754 0x25011722 |
#define | LPC1756 0x25011723 |
#define | LPC1758 0x25013F37 |
#define | LPC1759 0x25113737 |
#define | LPC1763 0x26012033 |
#define | LPC1764 0x26011922 |
#define | LPC1765 0x26013733 |
#define | LPC1766 0x26013F33 |
#define | LPC1767 0x26012837 |
#define | LPC1768 0x26013F37 |
#define | LPC1769 0x26113F37 |
#define | LPC1774 0x27011132 |
#define | LPC1776 0x27191F43 |
#define | LPC1777 0x27193747 |
#define | LPC1778 0x27193F47 |
#define | LPC1785 0x281D1743 |
#define | LPC1786 0x281D1F43 |
#define | LPC1787 0x281D3747 |
#define | LPC1788 0x281D3F47 |
#define | LPC4072 0x47011121 |
#define | LPC4074 0x47011132 |
#define | LPC4076 0x47191F43 |
#define | LPC4078 0x47193F47 |
#define | LPC4088 0x481D3F47 |
#define | LPC810_021 0x00008100 |
#define | LPC811_001 0x00008110 |
#define | LPC812_101 0x00008120 |
#define | LPC812_101_1 0x00008121 |
#define | LPC812_101_2 0x00008122 |
#define | LPC812_101_3 0x00008123 |
#define | LPC822_101 0x00008221 |
#define | LPC822_101_1 0x00008222 |
#define | LPC824_201 0x00008241 |
#define | LPC824_201_1 0x00008242 |
#define | LPC844_201 0x00008441 |
#define | LPC844_201_1 0x00008442 |
#define | LPC844_201_2 0x00008444 |
#define | LPC845_301 0x00008451 |
#define | LPC845_301_1 0x00008452 |
#define | LPC845_301_2 0x00008453 |
#define | LPC845_301_3 0x00008454 |
#define | LPC8N04 0x00008A04 |
#define | NHS3100 0x4e310020 |
#define | NHS3152 0x4e315220 |
#define | NHS3153 0x4e315320 /* Only specified in Rev.1 of the datasheet */ |
Enumerations | |
enum | lpc2000_status_codes { LPC2000_CMD_SUCCESS = 0 , LPC2000_INVALID_COMMAND = 1 , LPC2000_SRC_ADDR_ERROR = 2 , LPC2000_DST_ADDR_ERROR = 3 , LPC2000_SRC_ADDR_NOT_MAPPED = 4 , LPC2000_DST_ADDR_NOT_MAPPED = 5 , LPC2000_COUNT_ERROR = 6 , LPC2000_INVALID_SECTOR = 7 , LPC2000_SECTOR_NOT_BLANK = 8 , LPC2000_SECTOR_NOT_PREPARED = 9 , LPC2000_COMPARE_ERROR = 10 , LPC2000_BUSY = 11 , LPC2000_PARAM_ERROR = 12 , LPC2000_ADDR_ERROR = 13 , LPC2000_ADDR_NOT_MAPPED = 14 , LPC2000_CMD_NOT_LOCKED = 15 , LPC2000_INVALID_CODE = 16 , LPC2000_INVALID_BAUD_RATE = 17 , LPC2000_INVALID_STOP_BIT = 18 , LPC2000_CRP_ENABLED = 19 , LPC2000_INVALID_FLASH_UNIT = 20 , LPC2000_USER_CODE_CHECKSUM = 21 , LCP2000_ERROR_SETTING_ACTIVE_PARTITION = 22 } |
enum | lpc2000_variant { LPC2000_V1 , LPC2000_V2 , LPC1700 , LPC4300 , LPC800 , LPC1100 , LPC1500 , LPC54100 , LPC_AUTO } |
Functions | |
COMMAND_HANDLER (lpc2000_handle_part_id_command) | |
FLASH_BANK_COMMAND_HANDLER (lpc2000_flash_bank_command) | |
static int | get_lpc2000_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | get_lpc2000_part_id (struct flash_bank *bank, uint32_t *part_id) |
static int | lpc2000_auto_probe_flash (struct flash_bank *bank) |
static int | lpc2000_build_sector_list (struct flash_bank *bank) |
static int | lpc2000_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | lpc2000_erase_check (struct flash_bank *bank) |
static int | lpc2000_iap_blank_check (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | lpc2000_iap_call (struct flash_bank *bank, struct working_area *iap_working_area, int code, uint32_t param_table[5], uint32_t result_table[4]) |
static int | lpc2000_iap_working_area_init (struct flash_bank *bank, struct working_area **iap_working_area) |
static int | lpc2000_probe (struct flash_bank *bank) |
static int | lpc2000_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const struct command_registration | lpc2000_command_handlers [] |
static const struct command_registration | lpc2000_exec_command_handlers [] |
const struct flash_driver | lpc2000_flash |
flash programming support for NXP LPC8xx,LPC1xxx,LPC4xxx,LP5410x,LPC2xxx and NHS31xx devices.
Definition in file lpc2000.c.
#define NHS3153 0x4e315320 /* Only specified in Rev.1 of the datasheet */ |
enum lpc2000_status_codes |
enum lpc2000_variant |
COMMAND_HANDLER | ( | lpc2000_handle_part_id_command | ) |
Definition at line 1554 of file lpc2000.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, get_lpc2000_part_id(), LOG_ERROR, and TARGET_HALTED.
FLASH_BANK_COMMAND_HANDLER | ( | lpc2000_flash_bank_command | ) |
Definition at line 910 of file lpc2000.c.
References bank, lpc2000_flash_bank::calc_checksum, lpc2000_flash_bank::cclk, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_BANK_INVALID, ERROR_OK, lpc2000_flash_bank::iap_entry_alternative, lpc2000_flash_bank::iap_max_stack, LOG_ERROR, LPC1100, LPC1500, LPC1700, LPC2000_V1, LPC2000_V2, LPC4300, lpc2000_flash_bank::lpc4300_bank, LPC54100, LPC800, LPC_AUTO, lpc2000_flash_bank::probed, and lpc2000_flash_bank::variant.
|
static |
Definition at line 1544 of file lpc2000.c.
References bank, lpc2000_flash_bank::cclk, cmd, command_print_sameline(), ERROR_OK, and lpc2000_flash_bank::variant.
|
static |
Definition at line 1221 of file lpc2000.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LPC2000_CMD_SUCCESS, lpc2000_iap_call(), lpc2000_iap_working_area_init(), LPC2000_INVALID_COMMAND, target_free_working_area(), and TARGET_HALTED.
Referenced by COMMAND_HANDLER(), lpc2000_auto_probe_flash(), and lpc2000_probe().
|
static |
Definition at line 1252 of file lpc2000.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, get_lpc2000_part_id(), LOG_ERROR, LPC1100, LPC1110_1, LPC1110_2, LPC1111_002_1, LPC1111_002_2, LPC1111_101_1, LPC1111_101_2, LPC1111_103_1, LPC1111_201_1, LPC1111_201_2, LPC1111_203_1, LPC1112_101_1, LPC1112_101_2, LPC1112_102_1, LPC1112_102_2, LPC1112_103_1, LPC1112_201_1, LPC1112_201_2, LPC1112_203_1, LPC1113_201_1, LPC1113_201_2, LPC1113_203_1, LPC1113_301_1, LPC1113_301_2, LPC1113_303_1, LPC1114_102_1, LPC1114_102_2, LPC1114_201_1, LPC1114_201_2, LPC1114_203_1, LPC1114_301_1, LPC1114_301_2, LPC1114_303_1, LPC1114_323_1, LPC1114_333_1, LPC1115_303_1, LPC11A02_1, LPC11A04_1, LPC11A11_001_1, LPC11A12_101_1, LPC11A13_201_1, LPC11A14_301_1, LPC11A14_301_2, LPC11C12_301_1, LPC11C14_301_1, LPC11C22_301_1, LPC11C24_301_1, LPC11E11_101, LPC11E12_201, LPC11E13_301, LPC11E14_401, LPC11E36_501, LPC11E37_401, LPC11E37_501, LPC11E66, LPC11E67, LPC11E68, LPC11U12_201_1, LPC11U12_201_2, LPC11U13_201_1, LPC11U13_201_2, LPC11U14_201_1, LPC11U14_201_2, LPC11U23_301, LPC11U24_301, LPC11U24_401, LPC11U34_311, LPC11U34_421, LPC11U35_401, LPC11U35_501, LPC11U36_401, LPC11U37_401, LPC11U37_501, LPC11U37H_401, LPC11U66, LPC11U67_1, LPC11U67_2, LPC11U68_1, LPC11U68_2, LPC1311, LPC1311_1, LPC1313, LPC1313_1, LPC1315, LPC1316, LPC1317, LPC1342, LPC1343, LPC1343_1, LPC1345, LPC1346, LPC1347, LPC1700, LPC1751_1, LPC1751_2, LPC1752, LPC1754, LPC1756, LPC1758, LPC1759, LPC1763, LPC1764, LPC1765, LPC1766, LPC1767, LPC1768, LPC1769, LPC1774, LPC1776, LPC1777, LPC1778, LPC1785, LPC1786, LPC1787, LPC1788, LPC2000_CMD_SUCCESS, LPC4072, LPC4074, LPC4076, LPC4078, LPC4088, LPC800, LPC810_021, LPC811_001, LPC812_101, LPC812_101_1, LPC812_101_2, LPC812_101_3, LPC822_101, LPC822_101_1, LPC824_201, LPC824_201_1, LPC844_201, LPC844_201_1, LPC844_201_2, LPC845_301, LPC845_301_1, LPC845_301_2, LPC845_301_3, LPC8N04, NHS3100, NHS3152, NHS3153, TARGET_HALTED, and lpc2000_flash_bank::variant.
Referenced by lpc2000_probe().
|
static |
Definition at line 326 of file lpc2000.c.
References bank, lpc2000_flash_bank::checksum_vector, lpc2000_flash_bank::cmd51_dst_boundary, lpc2000_flash_bank::cmd51_max_buffer, ERROR_OK, lpc2000_flash_bank::iap_max_stack, LOG_ERROR, LPC1100, LPC11XX_REG_SECTORS, LPC1500, LPC1700, LPC2000_V1, LPC2000_V2, LPC4300, LPC54100, LPC800, offset, and lpc2000_flash_bank::variant.
Referenced by lpc2000_probe().
|
static |
Definition at line 971 of file lpc2000.c.
References bank, lpc2000_flash_bank::cclk, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_WARNING, LPC2000_CMD_SUCCESS, lpc2000_iap_call(), lpc2000_iap_working_area_init(), LPC2000_INVALID_SECTOR, LPC4300, lpc2000_flash_bank::lpc4300_bank, target_free_working_area(), TARGET_HALTED, and lpc2000_flash_bank::variant.
|
static |
Definition at line 1534 of file lpc2000.c.
References bank, ERROR_TARGET_NOT_HALTED, LOG_ERROR, lpc2000_iap_blank_check(), and TARGET_HALTED.
|
static |
Definition at line 855 of file lpc2000.c.
References bank, ERROR_FLASH_BUSY, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, LOG_ERROR, LPC2000_BUSY, LPC2000_CMD_SUCCESS, lpc2000_iap_call(), lpc2000_iap_working_area_init(), LPC2000_INVALID_SECTOR, LPC2000_SECTOR_NOT_BLANK, LPC4300, lpc2000_flash_bank::lpc4300_bank, target_free_working_area(), and lpc2000_flash_bank::variant.
Referenced by lpc2000_erase_check().
|
static |
Definition at line 721 of file lpc2000.c.
References working_area::address, ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_MODE_THREAD, ARM_STATE_ARM, ARMV7M_COMMON_MAGIC, bank, buf_set_u32(), arm_algorithm::common_magic, armv7m_algorithm::common_magic, arm_algorithm::core_mode, armv7m_algorithm::core_mode, arm_algorithm::core_state, destroy_mem_param(), destroy_reg_param(), IAP_CODE_LEN, lpc2000_flash_bank::iap_entry_alternative, lpc2000_flash_bank::iap_max_stack, init_mem_param(), init_reg_param(), LOG_DEBUG, LOG_ERROR, LPC1100, LPC1500, LPC1700, LPC2000_V1, LPC2000_V2, LPC4300, LPC54100, LPC800, LPC_AUTO, PARAM_IN, PARAM_OUT, target_buffer_get_u32(), target_buffer_set_u32(), target_read_u32(), target_run_algorithm(), mem_param::value, reg_param::value, and lpc2000_flash_bank::variant.
Referenced by get_lpc2000_part_id(), lpc2000_erase(), lpc2000_iap_blank_check(), and lpc2000_write().
|
static |
Definition at line 675 of file lpc2000.c.
References ARMV4_5_B, ARMV4_5_BX, ARMV4_5_T_BX, ARMV5_T_BKPT, bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, IAP_CODE_LEN, lpc2000_flash_bank::iap_max_stack, LOG_ERROR, LPC1100, LPC1500, LPC1700, LPC2000_V1, LPC2000_V2, LPC4300, LPC54100, LPC800, LPC_AUTO, TARGET_ADDR_FMT, target_alloc_working_area(), target_buffer_set_u32(), target_free_working_area(), target_write_memory(), and lpc2000_flash_bank::variant.
Referenced by get_lpc2000_part_id(), lpc2000_erase(), lpc2000_iap_blank_check(), and lpc2000_write().
|
static |
Definition at line 1509 of file lpc2000.c.
References bank, ERROR_OK, get_lpc2000_part_id(), LOG_INFO, LPC1100, LPC1700, lpc2000_auto_probe_flash(), lpc2000_build_sector_list(), LPC2000_CMD_SUCCESS, LPC_AUTO, lpc2000_flash_bank::probed, status, and lpc2000_flash_bank::variant.
|
static |
Definition at line 1048 of file lpc2000.c.
References working_area::address, bank, buf_get_u32(), buf_set_u32(), buffer, lpc2000_flash_bank::calc_checksum, lpc2000_flash_bank::cclk, lpc2000_flash_bank::checksum_vector, lpc2000_flash_bank::cmd51_dst_boundary, lpc2000_flash_bank::cmd51_max_buffer, count, DIV_ROUND_UP, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, working_area::free, LOG_DEBUG, LOG_ERROR, LOG_WARNING, LPC2000_CMD_SUCCESS, lpc2000_iap_call(), lpc2000_iap_working_area_init(), LPC2000_INVALID_SECTOR, LPC4300, lpc2000_flash_bank::lpc4300_bank, offset, TARGET_ADDR_FMT, target_alloc_working_area(), target_free_working_area(), TARGET_HALTED, target_write_buffer(), and lpc2000_flash_bank::variant.
|
static |
|
static |
const struct flash_driver lpc2000_flash |