OpenOCD
lpc2000.c File Reference

flash programming support for NXP LPC8xx,LPC1xxx,LPC4xxx,LP5410x,LPC2xxx and NHS31xx devices. More...

Include dependency graph for lpc2000.c:

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
 

Detailed Description

flash programming support for NXP LPC8xx,LPC1xxx,LPC4xxx,LP5410x,LPC2xxx and NHS31xx devices.

Todo:
Provide a way to update CCLK after declaring the flash bank. The value which is correct after chip reset will rarely still work right after the clocks switch to use the PLL (e.g. 4MHz --> 100 MHz).

Definition in file lpc2000.c.

Macro Definition Documentation

◆ IAP_CODE_LEN

#define IAP_CODE_LEN   0x34

Definition at line 271 of file lpc2000.c.

◆ LPC1110_1

#define LPC1110_1   0x0A07102B

Definition at line 117 of file lpc2000.c.

◆ LPC1110_2

#define LPC1110_2   0x1A07102B

Definition at line 118 of file lpc2000.c.

◆ LPC1111_002_1

#define LPC1111_002_1   0x0A16D02B

Definition at line 119 of file lpc2000.c.

◆ LPC1111_002_2

#define LPC1111_002_2   0x1A16D02B

Definition at line 120 of file lpc2000.c.

◆ LPC1111_101_1

#define LPC1111_101_1   0x041E502B

Definition at line 121 of file lpc2000.c.

◆ LPC1111_101_2

#define LPC1111_101_2   0x2516D02B

Definition at line 122 of file lpc2000.c.

◆ LPC1111_103_1

#define LPC1111_103_1   0x00010013

Definition at line 123 of file lpc2000.c.

◆ LPC1111_201_1

#define LPC1111_201_1   0x0416502B

Definition at line 124 of file lpc2000.c.

◆ LPC1111_201_2

#define LPC1111_201_2   0x2516902B

Definition at line 125 of file lpc2000.c.

◆ LPC1111_203_1

#define LPC1111_203_1   0x00010012

Definition at line 126 of file lpc2000.c.

◆ LPC1112_101_1

#define LPC1112_101_1   0x042D502B

Definition at line 127 of file lpc2000.c.

◆ LPC1112_101_2

#define LPC1112_101_2   0x2524D02B

Definition at line 128 of file lpc2000.c.

◆ LPC1112_102_1

#define LPC1112_102_1   0x0A24902B

Definition at line 129 of file lpc2000.c.

◆ LPC1112_102_2

#define LPC1112_102_2   0x1A24902B

Definition at line 130 of file lpc2000.c.

◆ LPC1112_103_1

#define LPC1112_103_1   0x00020023

Definition at line 131 of file lpc2000.c.

◆ LPC1112_201_1

#define LPC1112_201_1   0x0425502B

Definition at line 132 of file lpc2000.c.

◆ LPC1112_201_2

#define LPC1112_201_2   0x2524902B

Definition at line 133 of file lpc2000.c.

◆ LPC1112_203_1

#define LPC1112_203_1   0x00020022

Definition at line 134 of file lpc2000.c.

◆ LPC1113_201_1

#define LPC1113_201_1   0x0434502B

Definition at line 135 of file lpc2000.c.

◆ LPC1113_201_2

#define LPC1113_201_2   0x2532902B

Definition at line 136 of file lpc2000.c.

◆ LPC1113_203_1

#define LPC1113_203_1   0x00030032

Definition at line 137 of file lpc2000.c.

◆ LPC1113_301_1

#define LPC1113_301_1   0x0434102B

Definition at line 138 of file lpc2000.c.

◆ LPC1113_301_2

#define LPC1113_301_2   0x2532102B

Definition at line 139 of file lpc2000.c.

◆ LPC1113_303_1

#define LPC1113_303_1   0x00030030

Definition at line 140 of file lpc2000.c.

◆ LPC1114_102_1

#define LPC1114_102_1   0x0A40902B

Definition at line 141 of file lpc2000.c.

◆ LPC1114_102_2

#define LPC1114_102_2   0x1A40902B

Definition at line 142 of file lpc2000.c.

◆ LPC1114_201_1

#define LPC1114_201_1   0x0444502B

Definition at line 143 of file lpc2000.c.

◆ LPC1114_201_2

#define LPC1114_201_2   0x2540902B

Definition at line 144 of file lpc2000.c.

◆ LPC1114_203_1

#define LPC1114_203_1   0x00040042

Definition at line 145 of file lpc2000.c.

◆ LPC1114_301_1

#define LPC1114_301_1   0x0444102B

Definition at line 146 of file lpc2000.c.

◆ LPC1114_301_2

#define LPC1114_301_2   0x2540102B

Definition at line 147 of file lpc2000.c.

◆ LPC1114_303_1

#define LPC1114_303_1   0x00040040

Definition at line 148 of file lpc2000.c.

◆ LPC1114_323_1

#define LPC1114_323_1   0x00040060

Definition at line 149 of file lpc2000.c.

◆ LPC1114_333_1

#define LPC1114_333_1   0x00040070

Definition at line 150 of file lpc2000.c.

◆ LPC1115_303_1

#define LPC1115_303_1   0x00050080

Definition at line 151 of file lpc2000.c.

◆ LPC11A02_1

#define LPC11A02_1   0x4D4C802B

Definition at line 153 of file lpc2000.c.

◆ LPC11A04_1

#define LPC11A04_1   0x4D80002B

Definition at line 154 of file lpc2000.c.

◆ LPC11A11_001_1

#define LPC11A11_001_1   0x455EC02B

Definition at line 155 of file lpc2000.c.

◆ LPC11A12_101_1

#define LPC11A12_101_1   0x4574802B

Definition at line 156 of file lpc2000.c.

◆ LPC11A13_201_1

#define LPC11A13_201_1   0x458A402B

Definition at line 157 of file lpc2000.c.

◆ LPC11A14_301_1

#define LPC11A14_301_1   0x35A0002B

Definition at line 158 of file lpc2000.c.

◆ LPC11A14_301_2

#define LPC11A14_301_2   0x45A0002B

Definition at line 159 of file lpc2000.c.

◆ LPC11C12_301_1

#define LPC11C12_301_1   0x1421102B

Definition at line 161 of file lpc2000.c.

◆ LPC11C14_301_1

#define LPC11C14_301_1   0x1440102B

Definition at line 162 of file lpc2000.c.

◆ LPC11C22_301_1

#define LPC11C22_301_1   0x1431102B

Definition at line 163 of file lpc2000.c.

◆ LPC11C24_301_1

#define LPC11C24_301_1   0x1430102B

Definition at line 164 of file lpc2000.c.

◆ LPC11E11_101

#define LPC11E11_101   0x293E902B

Definition at line 166 of file lpc2000.c.

◆ LPC11E12_201

#define LPC11E12_201   0x2954502B

Definition at line 167 of file lpc2000.c.

◆ LPC11E13_301

#define LPC11E13_301   0x296A102B

Definition at line 168 of file lpc2000.c.

◆ LPC11E14_401

#define LPC11E14_401   0x2980102B

Definition at line 169 of file lpc2000.c.

◆ LPC11E36_501

#define LPC11E36_501   0x00009C41

Definition at line 170 of file lpc2000.c.

◆ LPC11E37_401

#define LPC11E37_401   0x00007C45

Definition at line 171 of file lpc2000.c.

◆ LPC11E37_501

#define LPC11E37_501   0x00007C41

Definition at line 172 of file lpc2000.c.

◆ LPC11E66

#define LPC11E66   0x0000DCC1

Definition at line 192 of file lpc2000.c.

◆ LPC11E67

#define LPC11E67   0x0000BC81

Definition at line 193 of file lpc2000.c.

◆ LPC11E68

#define LPC11E68   0x00007C01

Definition at line 194 of file lpc2000.c.

◆ LPC11U12_201_1

#define LPC11U12_201_1   0x095C802B

Definition at line 174 of file lpc2000.c.

◆ LPC11U12_201_2

#define LPC11U12_201_2   0x295C802B

Definition at line 175 of file lpc2000.c.

◆ LPC11U13_201_1

#define LPC11U13_201_1   0x097A802B

Definition at line 176 of file lpc2000.c.

◆ LPC11U13_201_2

#define LPC11U13_201_2   0x297A802B

Definition at line 177 of file lpc2000.c.

◆ LPC11U14_201_1

#define LPC11U14_201_1   0x0998802B

Definition at line 178 of file lpc2000.c.

◆ LPC11U14_201_2

#define LPC11U14_201_2   0x2998802B

Definition at line 179 of file lpc2000.c.

◆ LPC11U23_301

#define LPC11U23_301   0x2972402B

Definition at line 180 of file lpc2000.c.

◆ LPC11U24_301

#define LPC11U24_301   0x2988402B

Definition at line 181 of file lpc2000.c.

◆ LPC11U24_401

#define LPC11U24_401   0x2980002B

Definition at line 182 of file lpc2000.c.

◆ LPC11U34_311

#define LPC11U34_311   0x0003D440

Definition at line 183 of file lpc2000.c.

◆ LPC11U34_421

#define LPC11U34_421   0x0001CC40

Definition at line 184 of file lpc2000.c.

◆ LPC11U35_401

#define LPC11U35_401   0x0001BC40

Definition at line 185 of file lpc2000.c.

◆ LPC11U35_501

#define LPC11U35_501   0x0000BC40

Definition at line 186 of file lpc2000.c.

◆ LPC11U36_401

#define LPC11U36_401   0x00019C40

Definition at line 187 of file lpc2000.c.

◆ LPC11U37_401

#define LPC11U37_401   0x00017C40

Definition at line 188 of file lpc2000.c.

◆ LPC11U37_501

#define LPC11U37_501   0x00007C40

Definition at line 190 of file lpc2000.c.

◆ LPC11U37H_401

#define LPC11U37H_401   0x00007C44

Definition at line 189 of file lpc2000.c.

◆ LPC11U66

#define LPC11U66   0x0000DCC8

Definition at line 196 of file lpc2000.c.

◆ LPC11U67_1

#define LPC11U67_1   0x0000BC88

Definition at line 197 of file lpc2000.c.

◆ LPC11U67_2

#define LPC11U67_2   0x0000BC80

Definition at line 198 of file lpc2000.c.

◆ LPC11U68_1

#define LPC11U68_1   0x00007C08

Definition at line 199 of file lpc2000.c.

◆ LPC11U68_2

#define LPC11U68_2   0x00007C00

Definition at line 200 of file lpc2000.c.

◆ LPC11XX_REG_SECTORS

#define LPC11XX_REG_SECTORS   24

Definition at line 273 of file lpc2000.c.

◆ LPC1311

#define LPC1311   0x2C42502B

Definition at line 202 of file lpc2000.c.

◆ LPC1311_1

#define LPC1311_1   0x1816902B

Definition at line 203 of file lpc2000.c.

◆ LPC1313

#define LPC1313   0x2C40102B

Definition at line 204 of file lpc2000.c.

◆ LPC1313_1

#define LPC1313_1   0x1830102B

Definition at line 205 of file lpc2000.c.

◆ LPC1315

#define LPC1315   0x3A010523

Definition at line 206 of file lpc2000.c.

◆ LPC1316

#define LPC1316   0x1A018524

Definition at line 207 of file lpc2000.c.

◆ LPC1317

#define LPC1317   0x1A020525

Definition at line 208 of file lpc2000.c.

◆ LPC1342

#define LPC1342   0x3D01402B

Definition at line 209 of file lpc2000.c.

◆ LPC1343

#define LPC1343   0x3D00002B

Definition at line 210 of file lpc2000.c.

◆ LPC1343_1

#define LPC1343_1   0x3000002B

Definition at line 211 of file lpc2000.c.

◆ LPC1345

#define LPC1345   0x28010541

Definition at line 212 of file lpc2000.c.

◆ LPC1346

#define LPC1346   0x08018542

Definition at line 213 of file lpc2000.c.

◆ LPC1347

#define LPC1347   0x08020543

Definition at line 214 of file lpc2000.c.

◆ LPC1751_1

#define LPC1751_1   0x25001110

Definition at line 216 of file lpc2000.c.

◆ LPC1751_2

#define LPC1751_2   0x25001118

Definition at line 217 of file lpc2000.c.

◆ LPC1752

#define LPC1752   0x25001121

Definition at line 218 of file lpc2000.c.

◆ LPC1754

#define LPC1754   0x25011722

Definition at line 219 of file lpc2000.c.

◆ LPC1756

#define LPC1756   0x25011723

Definition at line 220 of file lpc2000.c.

◆ LPC1758

#define LPC1758   0x25013F37

Definition at line 221 of file lpc2000.c.

◆ LPC1759

#define LPC1759   0x25113737

Definition at line 222 of file lpc2000.c.

◆ LPC1763

#define LPC1763   0x26012033

Definition at line 223 of file lpc2000.c.

◆ LPC1764

#define LPC1764   0x26011922

Definition at line 224 of file lpc2000.c.

◆ LPC1765

#define LPC1765   0x26013733

Definition at line 225 of file lpc2000.c.

◆ LPC1766

#define LPC1766   0x26013F33

Definition at line 226 of file lpc2000.c.

◆ LPC1767

#define LPC1767   0x26012837

Definition at line 227 of file lpc2000.c.

◆ LPC1768

#define LPC1768   0x26013F37

Definition at line 228 of file lpc2000.c.

◆ LPC1769

#define LPC1769   0x26113F37

Definition at line 229 of file lpc2000.c.

◆ LPC1774

#define LPC1774   0x27011132

Definition at line 230 of file lpc2000.c.

◆ LPC1776

#define LPC1776   0x27191F43

Definition at line 231 of file lpc2000.c.

◆ LPC1777

#define LPC1777   0x27193747

Definition at line 232 of file lpc2000.c.

◆ LPC1778

#define LPC1778   0x27193F47

Definition at line 233 of file lpc2000.c.

◆ LPC1785

#define LPC1785   0x281D1743

Definition at line 234 of file lpc2000.c.

◆ LPC1786

#define LPC1786   0x281D1F43

Definition at line 235 of file lpc2000.c.

◆ LPC1787

#define LPC1787   0x281D3747

Definition at line 236 of file lpc2000.c.

◆ LPC1788

#define LPC1788   0x281D3F47

Definition at line 237 of file lpc2000.c.

◆ LPC4072

#define LPC4072   0x47011121

Definition at line 239 of file lpc2000.c.

◆ LPC4074

#define LPC4074   0x47011132

Definition at line 240 of file lpc2000.c.

◆ LPC4076

#define LPC4076   0x47191F43

Definition at line 241 of file lpc2000.c.

◆ LPC4078

#define LPC4078   0x47193F47

Definition at line 242 of file lpc2000.c.

◆ LPC4088

#define LPC4088   0x481D3F47

Definition at line 243 of file lpc2000.c.

◆ LPC810_021

#define LPC810_021   0x00008100

Definition at line 245 of file lpc2000.c.

◆ LPC811_001

#define LPC811_001   0x00008110

Definition at line 246 of file lpc2000.c.

◆ LPC812_101

#define LPC812_101   0x00008120

Definition at line 247 of file lpc2000.c.

◆ LPC812_101_1

#define LPC812_101_1   0x00008121

Definition at line 248 of file lpc2000.c.

◆ LPC812_101_2

#define LPC812_101_2   0x00008122

Definition at line 249 of file lpc2000.c.

◆ LPC812_101_3

#define LPC812_101_3   0x00008123

Definition at line 250 of file lpc2000.c.

◆ LPC822_101

#define LPC822_101   0x00008221

Definition at line 252 of file lpc2000.c.

◆ LPC822_101_1

#define LPC822_101_1   0x00008222

Definition at line 253 of file lpc2000.c.

◆ LPC824_201

#define LPC824_201   0x00008241

Definition at line 254 of file lpc2000.c.

◆ LPC824_201_1

#define LPC824_201_1   0x00008242

Definition at line 255 of file lpc2000.c.

◆ LPC844_201

#define LPC844_201   0x00008441

Definition at line 262 of file lpc2000.c.

◆ LPC844_201_1

#define LPC844_201_1   0x00008442

Definition at line 263 of file lpc2000.c.

◆ LPC844_201_2

#define LPC844_201_2   0x00008444

Definition at line 264 of file lpc2000.c.

◆ LPC845_301

#define LPC845_301   0x00008451

Definition at line 266 of file lpc2000.c.

◆ LPC845_301_1

#define LPC845_301_1   0x00008452

Definition at line 267 of file lpc2000.c.

◆ LPC845_301_2

#define LPC845_301_2   0x00008453

Definition at line 268 of file lpc2000.c.

◆ LPC845_301_3

#define LPC845_301_3   0x00008454

Definition at line 269 of file lpc2000.c.

◆ LPC8N04

#define LPC8N04   0x00008A04

Definition at line 257 of file lpc2000.c.

◆ NHS3100

#define NHS3100   0x4e310020

Definition at line 258 of file lpc2000.c.

◆ NHS3152

#define NHS3152   0x4e315220

Definition at line 259 of file lpc2000.c.

◆ NHS3153

#define NHS3153   0x4e315320 /* Only specified in Rev.1 of the datasheet */

Definition at line 260 of file lpc2000.c.

Enumeration Type Documentation

◆ lpc2000_status_codes

Enumerator
LPC2000_CMD_SUCCESS 
LPC2000_INVALID_COMMAND 
LPC2000_SRC_ADDR_ERROR 
LPC2000_DST_ADDR_ERROR 
LPC2000_SRC_ADDR_NOT_MAPPED 
LPC2000_DST_ADDR_NOT_MAPPED 
LPC2000_COUNT_ERROR 
LPC2000_INVALID_SECTOR 
LPC2000_SECTOR_NOT_BLANK 
LPC2000_SECTOR_NOT_PREPARED 
LPC2000_COMPARE_ERROR 
LPC2000_BUSY 
LPC2000_PARAM_ERROR 
LPC2000_ADDR_ERROR 
LPC2000_ADDR_NOT_MAPPED 
LPC2000_CMD_NOT_LOCKED 
LPC2000_INVALID_CODE 
LPC2000_INVALID_BAUD_RATE 
LPC2000_INVALID_STOP_BIT 
LPC2000_CRP_ENABLED 
LPC2000_INVALID_FLASH_UNIT 
LPC2000_USER_CODE_CHECKSUM 
LCP2000_ERROR_SETTING_ACTIVE_PARTITION 

Definition at line 300 of file lpc2000.c.

◆ lpc2000_variant

Enumerator
LPC2000_V1 
LPC2000_V2 
LPC1700 
LPC4300 
LPC800 
LPC1100 
LPC1500 
LPC54100 
LPC_AUTO 

Definition at line 275 of file lpc2000.c.

Function Documentation

◆ COMMAND_HANDLER()

◆ FLASH_BANK_COMMAND_HANDLER()

◆ get_lpc2000_info()

static int get_lpc2000_info ( struct flash_bank bank,
struct command_invocation cmd 
)
static

◆ get_lpc2000_part_id()

static int get_lpc2000_part_id ( struct flash_bank bank,
uint32_t *  part_id 
)
static

◆ lpc2000_auto_probe_flash()

static int lpc2000_auto_probe_flash ( struct flash_bank bank)
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().

◆ lpc2000_build_sector_list()

◆ lpc2000_erase()

◆ lpc2000_erase_check()

static int lpc2000_erase_check ( struct flash_bank bank)
static

◆ lpc2000_iap_blank_check()

◆ lpc2000_iap_call()

◆ lpc2000_iap_working_area_init()

◆ lpc2000_probe()

◆ lpc2000_write()

Variable Documentation

◆ lpc2000_command_handlers

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

Definition at line 1554 of file lpc2000.c.

◆ lpc2000_exec_command_handlers

const struct command_registration lpc2000_exec_command_handlers[]
static
Initial value:
= {
{
.name = "part_id",
.handler = lpc2000_handle_part_id_command,
.mode = COMMAND_EXEC,
.help = "print part id of lpc2000 flash bank <num>",
.usage = "<bank>",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 1554 of file lpc2000.c.

◆ lpc2000_flash

const struct flash_driver lpc2000_flash
Initial value:
= {
.name = "lpc2000",
.flash_bank_command = lpc2000_flash_bank_command,
.erase = lpc2000_erase,
.write = lpc2000_write,
.probe = lpc2000_probe,
.auto_probe = lpc2000_probe,
.erase_check = lpc2000_erase_check,
.free_driver_priv = default_flash_free_driver_priv,
}
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 lpc2000_probe(struct flash_bank *bank)
Definition: lpc2000.c:1509
static const struct command_registration lpc2000_command_handlers[]
Definition: lpc2000.c:1592
static int lpc2000_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: lpc2000.c:971
static int get_lpc2000_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: lpc2000.c:1544
static int lpc2000_erase_check(struct flash_bank *bank)
Definition: lpc2000.c:1534
static int lpc2000_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: lpc2000.c:1048

Definition at line 1554 of file lpc2000.c.