#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sysexits.h>
#include <ctype.h>
#include <unistd.h>
#include "dbg_msg.h"
#include "jt_instr.h"
#include "jt_arm.h"
#include "jt_cortex.h"
#include "jt_flash.h"
#include "arm_gdbstub.h"
#include "arm_memory_mmap.h"
#include "arm_memory_workspace.h"
#include "convert.h"
#define CRC32_POLY 0x04C10DB7 |
The CRC 32 polynomial is 32 26 23 22 16 12 11 10 8 7 5 4 2 1 0 X + X + X + X +X + X + X + X + X + X + X + X + X + X + X
3 3322 2222 2222 1111 1111 11 2 1098 7654 3210 9876 5432 1098 7654 3210
1 0000 0100 1100 0001 0000 1101 1011 0111
0x104C10DB7
Referenced by arm_checksum_crc32().
#define CRC16_POLY 0x1021 |
The CRC 16 polynominal is 16 12 5 0 x + x + x + x
1 1111 11 6 5432 1098 7654 3210
1 0001 0000 0010 0001
0x11021
Referenced by arm_checksum_crc16().
uint32_t arm_checksum_crc32 | ( | uint32_t * | block, | |
int | bit_len | |||
) |
calculate a crc checksum using CRC32_POLY
block | Pointer to data block | |
bit_len |
References CRC32_POLY.
Referenced by gdb_check_memory_block().
uint32_t arm_checksum_crc16 | ( | uint16_t * | block, | |
int | bit_len | |||
) |
calculate a crc checksum using CRC16_POLY
block | Pointer to data block | |
bit_len |
References CRC16_POLY.
Referenced by gdb_check_memory_block().
int gdb_check_memory_block | ( | uint32_t | addr, | |
uint32_t | word_len, | |||
uint32_t * | buf | |||
) |
Do a CRC32 and a CRC16 at both the host and the target side
0 | if equal | |
1 | if different | |
2 | if error with the protocol | |
3 | if workspace not present or unusable |
References arm_checksum_crc16(), arm_checksum_crc32(), convertDiffTimeToMsec, CPU, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), ICERT_REG_DCC_CONTROL, ICERT_REG_DCC_DATA, IF_DBG, jtag_arm_IceRT_RegRead(), jtag_arm_IceRT_RegRead_Once(), jtag_arm_IceRT_RegWrite(), jtag_arm_Mointor2DebugMode(), jtag_arm_PollDbgState(), jtag_arm_ReadWord(), jtag_arm_RunProgram(), jtag_arm_WriteWord(), jtag_cortex_core_StopRunningProgram(), reg_set::Regs::r, reg_set::regs, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), useWorkspace(), WORKSPACE_ALGO_CHECK, WORKSPACE_ALGO_CORTEX_CHECK, and WORKSPACE_SEGMENT_SIZE.
Referenced by checkFlashCB_read_sector().