21 #define FLASH_MASS_ERASE_TIMEOUT 2400
22 #define FLASH_ERASE_TIMEOUT 500
23 #define FLASH_WRITE_TIMEOUT 5
24 #define HICK_STABLE_TIMEOUT 1000
101 .has_epp_ext =
false,
102 .flash_regs_base = 0x40022000,
104 .crm_base = 0x40021000,
105 .usd_base = 0x1FFFF800,
109 .has_fap_high_level =
false,
110 .has_epp_ext =
false,
111 .flash_regs_base = 0x40022000,
113 .crm_base = 0x40021000,
114 .usd_base = 0x1FFFF800,
118 .has_fap_high_level =
true,
119 .has_epp_ext =
false,
120 .flash_regs_base = 0x40022000,
122 .crm_base = 0x40021000,
123 .usd_base = 0x1FFFF800,
127 .has_fap_high_level =
true,
128 .has_epp_ext =
false,
129 .flash_regs_base = 0x40022000,
131 .crm_base = 0x40021000,
132 .usd_base = 0x1FFFF800,
136 .has_fap_high_level =
true,
137 .has_epp_ext =
false,
138 .flash_regs_base = 0x40023C00,
140 .crm_base = 0x40023800,
141 .usd_base = 0x1FFFF800,
145 .has_fap_high_level =
true,
146 .has_epp_ext =
false,
147 .flash_regs_base = 0x40022000,
149 .crm_base = 0x40021000,
150 .usd_base = 0x1FFFF800,
154 .has_fap_high_level =
false,
156 .flash_regs_base = 0x40023C00,
158 .crm_base = 0x40023800,
159 .usd_base = 0x1FFFC000,
163 .has_fap_high_level =
true,
164 .has_epp_ext =
false,
165 .flash_regs_base = 0x40022000,
167 .crm_base = 0x40021000,
168 .usd_base = 0x1FFFF800,
176 .name =
"AT32F403AVCT7",
185 .name =
"AT32F403ARCT7",
194 .name =
"AT32F403ACCT7",
203 .name =
"AT32F403ACCU7",
212 .name =
"AT32F407VCT7",
221 .name =
"AT32F407RCT7",
230 .name =
"AT32F403AVET7",
239 .name =
"AT32F403ARET7",
248 .name =
"AT32F403ACET7",
257 .name =
"AT32F403ACEU7",
266 .name =
"AT32F407VET7",
275 .name =
"AT32F407RET7",
284 .name =
"AT32F407AVCT7",
293 .name =
"AT32F413RCT7",
302 .name =
"AT32F413RBT7",
311 .name =
"AT32F413CCT7",
320 .name =
"AT32F413CBT7",
329 .name =
"AT32F413KCU7-4",
338 .name =
"AT32F413KBU7-4",
347 .name =
"AT32F413C8T7",
356 .name =
"AT32F413CCU7",
365 .name =
"AT32F413CBU7",
374 .name =
"AT32F415RCT7",
379 .usd_data_size = 506,
383 .name =
"AT32F415CCT7",
388 .usd_data_size = 506,
392 .name =
"AT32F415KCU7-4",
397 .usd_data_size = 506,
401 .name =
"AT32F415RCT7-7",
406 .usd_data_size = 506,
410 .name =
"AT32F415RBT7",
415 .usd_data_size = 506,
419 .name =
"AT32F415CBT7",
424 .usd_data_size = 506,
428 .name =
"AT32F415KBU7-4",
433 .usd_data_size = 506,
437 .name =
"AT32F415RBT7-7",
442 .usd_data_size = 506,
446 .name =
"AT32F415R8T7",
451 .usd_data_size = 506,
455 .name =
"AT32F415C8T7",
460 .usd_data_size = 506,
464 .name =
"AT32F415K8U7-4",
469 .usd_data_size = 506,
473 .name =
"AT32F415CCU7",
478 .usd_data_size = 506,
482 .name =
"AT32F415CBU7",
487 .usd_data_size = 506,
491 .name =
"AT32F421C8T7",
496 .usd_data_size = 250,
500 .name =
"AT32F421K8T7",
505 .usd_data_size = 250,
509 .name =
"AT32F421K8U7",
514 .usd_data_size = 250,
518 .name =
"AT32F421K8U7-4",
523 .usd_data_size = 250,
527 .name =
"AT32F421F8U7",
532 .usd_data_size = 250,
536 .name =
"AT32F421F8P7",
541 .usd_data_size = 250,
545 .name =
"AT32F421C6T7",
550 .usd_data_size = 250,
554 .name =
"AT32F421K6T7",
559 .usd_data_size = 250,
563 .name =
"AT32F421K6U7",
568 .usd_data_size = 250,
572 .name =
"AT32F421K6U7-4",
577 .usd_data_size = 250,
581 .name =
"AT32F421F6U7",
586 .usd_data_size = 250,
590 .name =
"AT32F421F6P7",
595 .usd_data_size = 250,
599 .name =
"AT32F421C4T7",
604 .usd_data_size = 250,
608 .name =
"AT32F421K4T7",
613 .usd_data_size = 250,
617 .name =
"AT32F421K4U7",
622 .usd_data_size = 250,
626 .name =
"AT32F421K4U7-4",
631 .usd_data_size = 250,
635 .name =
"AT32F421F4U7",
640 .usd_data_size = 250,
644 .name =
"AT32F421F4P7",
649 .usd_data_size = 250,
653 .name =
"AT32F421G8U7",
658 .usd_data_size = 250,
662 .name =
"AT32F421G6U7",
667 .usd_data_size = 250,
671 .name =
"AT32F421G4U7",
676 .usd_data_size = 250,
680 .name =
"AT32F423VCT7",
685 .usd_data_size = 250,
689 .name =
"AT32F423VBT7",
694 .usd_data_size = 250,
698 .name =
"AT32F423V8T7",
703 .usd_data_size = 250,
707 .name =
"AT32F423RCT7",
712 .usd_data_size = 250,
716 .name =
"AT32F423RBT7",
721 .usd_data_size = 250,
725 .name =
"AT32F423R8T7",
730 .usd_data_size = 250,
734 .name =
"AT32F423RCT7-7",
739 .usd_data_size = 250,
743 .name =
"AT32F423RBT7-7",
748 .usd_data_size = 250,
752 .name =
"AT32F423R8T7-7",
757 .usd_data_size = 250,
761 .name =
"AT32F423CCT7",
766 .usd_data_size = 250,
770 .name =
"AT32F423CBT7",
775 .usd_data_size = 250,
779 .name =
"AT32F423C8T7",
784 .usd_data_size = 250,
788 .name =
"AT32F423CCU7",
793 .usd_data_size = 250,
797 .name =
"AT32F423CBU7",
802 .usd_data_size = 250,
806 .name =
"AT32F423C8U7",
811 .usd_data_size = 250,
815 .name =
"AT32F423TCU7",
820 .usd_data_size = 250,
824 .name =
"AT32F423TBU7",
829 .usd_data_size = 250,
833 .name =
"AT32F423T8U7",
838 .usd_data_size = 250,
842 .name =
"AT32F423KCU7-4",
847 .usd_data_size = 250,
851 .name =
"AT32F423KBU7-4",
856 .usd_data_size = 250,
860 .name =
"AT32F423K8U7-4",
865 .usd_data_size = 250,
869 .name =
"AT32F425R8T7",
874 .usd_data_size = 250,
878 .name =
"AT32F425R6T7",
883 .usd_data_size = 250,
887 .name =
"AT32F425R8T7-7",
892 .usd_data_size = 250,
896 .name =
"AT32F425R6T7-7",
901 .usd_data_size = 250,
905 .name =
"AT32F425C8T7",
910 .usd_data_size = 250,
914 .name =
"AT32F425C6T7",
919 .usd_data_size = 250,
923 .name =
"AT32F425C8U7",
928 .usd_data_size = 250,
932 .name =
"AT32F425C6U7",
937 .usd_data_size = 250,
941 .name =
"AT32F425K8T7",
946 .usd_data_size = 250,
950 .name =
"AT32F425K6T7",
955 .usd_data_size = 250,
959 .name =
"AT32F425K8U7-4",
964 .usd_data_size = 250,
968 .name =
"AT32F425K6U7-4",
973 .usd_data_size = 250,
977 .name =
"AT32F425F8P7",
982 .usd_data_size = 250,
986 .name =
"AT32F425F6P7",
991 .usd_data_size = 250,
995 .name =
"AT32F435ZDT7",
1000 .usd_data_size = 2012,
1004 .name =
"AT32F435ZCT7",
1009 .usd_data_size = 220,
1013 .name =
"AT32F435VDT7",
1018 .usd_data_size = 2012,
1022 .name =
"AT32F435VCT7",
1027 .usd_data_size = 220,
1031 .name =
"AT32F435RDT7",
1036 .usd_data_size = 2012,
1040 .name =
"AT32F435RCT7",
1045 .usd_data_size = 220,
1049 .name =
"AT32F435CDT7",
1054 .usd_data_size = 2012,
1058 .name =
"AT32F435CCT7",
1063 .usd_data_size = 220,
1067 .name =
"AT32F435CDU7",
1072 .usd_data_size = 2012,
1076 .name =
"AT32F435CCU7",
1081 .usd_data_size = 220,
1085 .name =
"AT32F437ZDT7",
1090 .usd_data_size = 2012,
1094 .name =
"AT32F437ZCT7",
1099 .usd_data_size = 220,
1103 .name =
"AT32F437VDT7",
1108 .usd_data_size = 2012,
1112 .name =
"AT32F437VCT7",
1117 .usd_data_size = 220,
1121 .name =
"AT32F437RDT7",
1126 .usd_data_size = 2012,
1130 .name =
"AT32F437RCT7",
1135 .usd_data_size = 220,
1139 .name =
"AT32WB415CCU7-7",
1144 .usd_data_size = 506,
1204 LOG_ERROR(
"Timed out waiting for flash");
1250 LOG_ERROR(
"Timed out waiting for flash");
1287 LOG_ERROR(
"Failed to unlock user system data");
1318 LOG_ERROR(
"Failed to lock user system data");
1364 LOG_ERROR(
"Failed to initialize flash memory");
1419 uint64_t prot = epps0;
1429 prot |= (((uint64_t)epps1) << 32);
1443 LOG_ERROR(
"Failed to read flash protection settings");
1447 for (
unsigned int i = 0; i <
bank->num_prot_blocks; i++) {
1448 const bool protected = !(prot & (UINT64_C(1) << i));
1449 bank->prot_blocks[i].is_protected =
protected ? 1 : 0;
1468 LOG_ERROR(
"Failed to initialize flash controller");
1477 LOG_ERROR(
"Failed to write FLASH_STS register");
1486 for (
unsigned int i = first; i <= last; i++) {
1488 bank->base +
bank->sectors[i].offset);
1491 LOG_ERROR(
"Failed to write FLASH_ADDR register");
1499 LOG_ERROR(
"Failed to write FLASH_CTRL register");
1512 LOG_ERROR(
"Failed to read FLASH_STS register");
1517 LOG_ERROR(
"Sector %u is write protected", i);
1528 return retval_deinit;
1542 LOG_ERROR(
"Failed to allocate USD buffer");
1575 switch (fap_level) {
1587 for (
unsigned int i = 0; i < 4; i++) {
1596 for (
unsigned int i = 0; i < 4; i++) {
1609 for (
unsigned int i = 0; i < part_info->
usd_data_size - 2; i++) {
1618 uint32_t
offset, uint8_t data)
1634 for (
unsigned int i = 0; i < 4; i++) {
1635 const uint8_t prot = usd->
protection >> (i * 8);
1640 for (
unsigned int i = 0; i < 4; i++) {
1652 for (
unsigned int i = 0; i < part_info->
usd_data_size - 2; i++) {
1672 LOG_ERROR(
"Failed to write FLASH_STS register");
1681 LOG_ERROR(
"Failed to write FLASH_CTRL register");
1691 unsigned int bytes_written = 0;
1700 memcpy(&tmp,
buffer + bytes_written,
sizeof(tmp));
1702 if (tmp != 0xffffffff) {
1706 LOG_ERROR(
"Failed to write user system data");
1723 LOG_ERROR(
"Failed to read FLASH_STS register");
1728 LOG_ERROR(
"Failed to program user system data");
1747 LOG_ERROR(
"Failed to write FLASH_CTRL register");
1760 LOG_ERROR(
"Failed to read FLASH_STS register");
1767 LOG_ERROR(
"Failed to read FLASH_CTRL register");
1791 if (fap_high && fap_low)
1820 LOG_ERROR(
"Protection cannot be modified when FAP is active");
1824 uint8_t *usd_buffer;
1833 LOG_ERROR(
"Failed to read user system data");
1844 LOG_ERROR(
"Failed to load user system data");
1849 for (
unsigned int i = first; i <=
MIN(31, last); i++) {
1850 if (
bank->prot_blocks[i].is_protected == set)
1859 for (
unsigned int i = 32; i <= last; i++) {
1860 if (
bank->prot_blocks[i].is_protected == set)
1873 LOG_ERROR(
"Failed to initialize flash controller");
1881 LOG_ERROR(
"Failed to erase user system data");
1891 LOG_ERROR(
"Failed to write user system data");
1900 return retval_deinit;
1919 LOG_ERROR(
"failed to write ctrl register");
1923 const uint32_t block_size = 4;
1925 uint32_t bytes_written = 0;
1928 for (uint32_t i = 0; i <
count / block_size; i++) {
1941 bytes_written += block_size;
1959 LOG_ERROR(
"Failed to initialize flash controller");
1966 LOG_ERROR(
"Failed to write flash memory");
1977 return retval_deinit;
1992 LOG_ERROR(
"Target is not a Cortex-M device");
2007 bool check_device_series =
false;
2021 check_device_series =
true;
2031 if (check_device_series &&
artery_parts[i].series != device_series)
2041 LOG_ERROR(
"Cannot identify target as an Artery device");
2051 free(
bank->sectors);
2056 const unsigned int num_pages = (
bank->size) / part_info->
page_size;
2059 bank->write_start_alignment = 4;
2060 bank->write_end_alignment = 4;
2062 bank->num_sectors = num_pages;
2065 if (!
bank->sectors) {
2066 LOG_ERROR(
"Failed to allocate bank sectors");
2070 for (
unsigned int i = 0; i <
bank->num_sectors; i++) {
2073 bank->sectors[i].is_erased = -1;
2074 bank->sectors[i].is_protected = 0;
2077 free(
bank->prot_blocks);
2117 const unsigned int num_prot_blocks_1 = 32;
2119 const unsigned int num_prot_blocks = num_prot_blocks_1 + num_prot_blocks_2;
2120 bank->num_prot_blocks = num_prot_blocks;
2123 if (!
bank->prot_blocks) {
2124 LOG_ERROR(
"Failed to allocate protection blocks");
2128 const uint32_t prot_block_size = 4096;
2131 uint32_t block_offset = 0;
2133 for (i = 0; i < 32; i++) {
2134 bank->prot_blocks[i].offset = block_offset;
2135 bank->prot_blocks[i].size = prot_block_size;
2136 bank->prot_blocks[i].is_erased = -1;
2137 bank->prot_blocks[i].is_protected = -1;
2139 block_offset += prot_block_size;
2142 const uint32_t prot_block_size_2 = 128 * 1024;
2144 for (; i < (num_prot_blocks - 1); i++) {
2145 bank->prot_blocks[i].offset = block_offset;
2146 bank->prot_blocks[i].size = prot_block_size_2;
2147 bank->prot_blocks[i].is_erased = -1;
2148 bank->prot_blocks[i].is_protected = -1;
2150 block_offset += prot_block_size_2;
2153 bank->prot_blocks[i].offset = block_offset;
2154 bank->prot_blocks[i].size =
bank->size - block_offset;
2155 bank->prot_blocks[i].is_erased = -1;
2156 bank->prot_blocks[i].is_protected = -1;
2158 uint32_t prot_block_size;
2160 switch (part_info->
series) {
2166 prot_block_size = 4096;
2170 prot_block_size = 2048;
2173 LOG_ERROR(
"Unknown Artery device series");
2177 const unsigned int num_prot_blocks =
MIN(
bank->size / prot_block_size, 32);
2178 bank->num_prot_blocks = num_prot_blocks;
2181 if (!
bank->prot_blocks) {
2182 LOG_ERROR(
"Failed to allocate protection blocks");
2188 for (i = 0; i < (num_prot_blocks - 1); i++) {
2189 bank->prot_blocks[i].offset = i * prot_block_size;
2190 bank->prot_blocks[i].size = prot_block_size;
2191 bank->prot_blocks[i].is_erased = -1;
2192 bank->prot_blocks[i].is_protected = -1;
2195 bank->prot_blocks[i].offset = i * prot_block_size;
2196 bank->prot_blocks[i].size = (
bank->size - (i * prot_block_size));
2197 bank->prot_blocks[i].is_erased = -1;
2198 bank->prot_blocks[i].is_protected = -1;
2237 LOG_ERROR(
"Failed to initialize flash controller");
2251 LOG_ERROR(
"Failed to write FLASH_CTRL register");
2259 LOG_ERROR(
"Failed to write FLASH_CTRL register");
2272 LOG_ERROR(
"Failed to read FLASH_STS register");
2277 LOG_ERROR(
"Mass erase operation failed");
2288 return retval_deinit;
2315 uint8_t *usd_buffer;
2344 LOG_ERROR(
"Failed to initialize flash controller");
2369 return retval_deinit;
2386 LOG_ERROR(
"Failed to initialize flash controller");
2393 LOG_ERROR(
"Failed to erase user system data");
2407 LOG_ERROR(
"Failed to write FLASH_STS register");
2416 LOG_ERROR(
"Failed to write FLASH_CTRL register");
2454 return retval_deinit;
2542 .handler = artery_handle_fap_enable_command,
2544 .usage =
"<bank_id>",
2545 .help =
"Enable flash access protection (FAP)",
2549 .handler = artery_handle_fap_disable_command,
2551 .usage =
"<bank_id>",
2552 .help =
"Disable flash access protection (FAP)",
2556 .handler = artery_handle_fap_state_command,
2558 .usage =
"<bank_id>",
2559 .help =
"Get the flash access protection (FAP) state",
2569 .help =
"flash access protection (FAP) command group",
2574 .
name =
"mass_erase",
2575 .handler = artery_handle_mass_erase_command,
2577 .usage =
"<bank_id>",
2578 .help =
"Erase entire flash memory",
2587 .help =
"artery flash command group",
2597 .flash_bank_command = artery_flash_bank_command,
static int artery_usd_write(struct flash_bank *bank, const uint8_t *buffer)
#define HICK_STABLE_TIMEOUT
#define FLASH_ERASE_TIMEOUT
const struct flash_driver artery_flash
static const struct command_registration artery_command_handlers[]
static int artery_usd_init(struct flash_bank *bank, uint8_t **buffer)
static void artery_usd_write_buffer(uint8_t *buffer, uint32_t base, uint32_t offset, uint8_t data)
static int artery_disable_fap(struct flash_bank *bank)
static int artery_probe(struct flash_bank *bank)
static int artery_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
static int artery_mass_erase(struct flash_bank *bank)
static const struct artery_part_info artery_parts[]
static int artery_info(struct flash_bank *bank, struct command_invocation *cmd)
FLASH_BANK_COMMAND_HANDLER(artery_flash_bank_command)
static int artery_usd_read(struct flash_bank *bank, uint8_t *buffer)
static int artery_usd_unlock(struct flash_bank *bank)
static int artery_auto_probe(struct flash_bank *bank)
static int artery_protect(struct flash_bank *bank, int set, unsigned int first, unsigned int last)
static const struct command_registration artery_exec_command_handlers[]
static int artery_enable_hiclk(struct flash_bank *bank)
static uint8_t artery_usd_read_buffer(const uint8_t *buffer, uint32_t base, uint32_t offset)
static int artery_usd_lock(struct flash_bank *bank)
static const uint32_t flash_regs_f4xx_wb415[ARTERY_FLASH_REG_INDEX_NUM]
static int artery_usd_erase(struct flash_bank *bank)
static int artery_write_flash_register(struct flash_bank *bank, enum artery_flash_reg_index reg, uint32_t value)
COMMAND_HANDLER(artery_handle_fap_enable_command)
static int artery_wait_flash_busy(struct flash_bank *bank, unsigned int timeout)
static int artery_read_protection(struct flash_bank *bank, uint64_t *protection)
static const uint32_t flash_regs_f435_f437[ARTERY_FLASH_REG_INDEX_NUM]
static const uint32_t usd_offsets_f4xx_wb415[ARTERY_USD_INDEX_NUM]
static int artery_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
static const uint32_t usd_offsets_f403a_f407_f413[ARTERY_USD_INDEX_NUM]
static int artery_read_flash_register(struct flash_bank *bank, enum artery_flash_reg_index reg, uint32_t *value)
static int artery_usd_load(const struct artery_part_info *part_info, const uint8_t *buffer, struct artery_usd *usd)
static const uint32_t usd_offsets_f435_f437[ARTERY_USD_INDEX_NUM]
static int artery_deinit_flash(struct flash_bank *bank)
static int artery_init_flash(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 const struct command_registration artery_fap_command_handlers[]
static int artery_protect_check(struct flash_bank *bank)
#define FLASH_WRITE_TIMEOUT
#define FLASH_MASS_ERASE_TIMEOUT
static int artery_write_without_loader(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
static int artery_get_fap(struct flash_bank *bank, enum artery_fap_level *fap_level)
@ ARTERY_FLASH_REG_USD_UNLOCK
@ ARTERY_FLASH_REG_INDEX_NUM
@ ARTERY_FLASH_REG_UNLOCK
#define FLASH_CTRL_SECERS
@ ARTERY_FAP_LEVEL_DISABLED
#define CRM_CTRL_HICKSTBL
#define FLASH_CTRL_USDULKS
#define FLASH_CTRL_USDERS
#define FLASH_STS_PRGMERR
#define FLASH_CTRL_BANKERS
@ ARTERY_USD_EPP_EXT_INDEX
@ ARTERY_USD_DATA_EXT_INDEX
@ ARTERY_SERIES_F403A_F407
@ ARTERY_SERIES_F435_F437
#define FLASH_CTRL_USDPRGM
Support functions to access arbitrary bits in a byte array.
void command_print_sameline(struct command_invocation *cmd, const char *format,...)
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CALL_COMMAND_HANDLER(name, extra ...)
Use this to macro to call a command helper (or a nested handler).
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static struct cortex_m_common * target_to_cortex_m_safe(struct target *target)
uint64_t buffer
Pointer to data buffer to send over SPI.
uint32_t address
Starting address. Sector aligned.
#define ERROR_FLASH_PROTECTED
#define ERROR_FLASH_OPERATION_FAILED
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
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.
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
struct rtt_control ctrl
Control block.
enum artery_series series
const uint32_t * flash_regs
uint8_t data[ARTERY_USD_DATA_MAX_SIZE]
enum artery_fap_level fap_level
When run_command is called, a new instance will be created on the stack, filled with the proper value...
struct armv7m_common armv7m
Provides details of a flash bank, available either on-chip or through a major interface.
Provides the implementation-independent structure that defines all of the callbacks required by OpenO...
const char * name
Gives a human-readable name of this flash driver, This field is used to select and initialize the dri...
Describes the geometry and status of a single flash sector within a flash bank.
int target_write_u16(struct target *target, target_addr_t address, uint16_t value)
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
int target_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
Write count items of size bytes to the memory of target at the address given.
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
int target_read_u32(struct target *target, target_addr_t address, uint32_t *value)
#define ERROR_TARGET_NOT_HALTED
static bool target_was_examined(const struct target *target)
#define ERROR_TARGET_INVALID
#define ERROR_TARGET_NOT_EXAMINED
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
#define DIV_ROUND_UP(m, n)
Rounds m up to the nearest multiple of n using division.