#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/time.h>
#include "dbg_msg.h"
#include "jt_arm.h"
#include "jt_cortex.h"
#include "jt_instr.h"
#include "convert.h"
DAP interface for ARM Cortex-M3
void jtag_cortex_AHB_attach | ( | void | ) |
Attach to AHB-AP
- |
References AUTO_INCR_OFF_AP_CONTROL, currentAddrIncr, currentSize, DEFAULT_AHB_AP_CONTROL, jtag_cortex_ApAHB_CtrlRegWrite(), jtag_cortex_ApAHB_IdRegRead(), jtag_cortex_ApAHB_StatRegRead(), jtag_cotrex_DpCtrl_RegWrite(), jtag_cotrex_DpRdBuff_RegRead(), jtag_cotrex_DpStat_RegRead(), and SIZE_WORD_AHB_AP_CONTROL.
Referenced by jtag_cortex_core_restart(), and jtag_test().
void jtag_cortex_AHB_setmodeTar | ( | uint32_t | addrInc, | |
uint32_t | size, | |||
uint32_t | address | |||
) |
set AHB transfer mode and taransfer address
addrInc | Auto Address increment 0, 0x10, 0x20 for off-, single- or packed- mode | |
size | transfersize: 0,1,2 for 8-bit, 16-bit or 32-bit | |
address |
References AUTO_INCR_OFF_AP_CONTROL, currentAddrIncr, currentSize, currentTar, DEFAULT_AHB_AP_CONTROL, jtag_cortex_ApAHB_CtrlRegWrite(), jtag_cortex_ApAHB_TarRegWrite(), transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), and transaction::uplevel.
Referenced by jtag_cortex_AHB_ReadByte(), jtag_cortex_AHB_ReadHalfword(), jtag_cortex_AHB_ReadWord(), jtag_cortex_AHB_ReadWordMemory(), jtag_cortex_AHB_WriteByte(), jtag_cortex_AHB_WriteHalfword(), jtag_cortex_AHB_WriteMemoryBuf(), jtag_cortex_AHB_WriteWord(), jtag_cortex_core_ApplicationInterruptResetControl_ReadRegister(), jtag_cortex_core_ApplicationInterruptResetControl_WriteRegister(), jtag_cortex_core_BusFaultAddress_ReadRegister(), jtag_cortex_core_BusFaultAddress_WriteRegister(), jtag_cortex_core_ConfigurationControl_ReadRegister(), jtag_cortex_core_ConfigurationControl_WriteRegister(), jtag_cortex_core_CPUID_ReadRegister(), jtag_cortex_core_debugExceptionMonitorControl_ReadRegister(), jtag_cortex_core_debugExceptionMonitorControl_WriteRegister(), jtag_cortex_core_DebugFaultStatus_ReadRegister(), jtag_cortex_core_DebugFaultStatus_WriteRegister(), jtag_cortex_core_debugHaltingControlStatus_ReadRegister(), jtag_cortex_core_debugHaltingControlStatus_WriteRegister(), jtag_cortex_core_HardFaultStatus_ReadRegister(), jtag_cortex_core_HardFaultStatus_WriteRegister(), jtag_cortex_core_MemManageAddress_ReadRegister(), jtag_cortex_core_MemManageAddress_WriteRegister(), jtag_cortex_core_PollDbgState(), jtag_cortex_core_ReadCpuRegs(), jtag_cortex_core_ReadDebugReg(), jtag_cortex_core_restart(), jtag_cortex_core_StopRunningProgram(), jtag_cortex_core_WriteCpuRegs(), jtag_cortex_dwt_comp_RegRead(), jtag_cortex_dwt_comp_RegWrite(), jtag_cortex_dwt_ctrl_RegRead(), jtag_cortex_dwt_ctrl_RegWrite(), jtag_cortex_dwt_function_RegRead(), jtag_cortex_dwt_function_RegWrite(), jtag_cortex_dwt_mask_RegRead(), jtag_cortex_dwt_mask_RegWrite(), jtag_cortex_fpb_comp_RegRead(), jtag_cortex_fpb_comp_RegWrite(), jtag_cortex_fpb_ctrl_RegRead(), jtag_cortex_fpb_ctrl_RegWrite(), and jtag_test().
void jtag_cortex_AHB_ReadWordMemory | ( | uint32_t | address, | |
int | howmanywords, | |||
uint32_t * | buf | |||
) |
Read out word memory into the given buffer.
address | target machine address | |
howmanywords | number of words to read | |
buf | pointer to destination read buffer (memory at server side) |
References AUTO_INCR_SINGLE_AP_CONTROL, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegRead(), jtag_cotrex_DpRdBuff_RegRead(), transaction::parameter, SIZE_WORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), and transaction::uplevel.
Referenced by jtag_arm_ReadWordMemory(), jtag_cortex_core_ReadCpuRegs(), and jtag_test().
uint32_t jtag_cortex_AHB_ReadWord | ( | uint32_t | address | ) |
read single 32-bit data from address
address | target machine address |
References AUTO_INCR_OFF_AP_CONTROL, jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegRead(), jtag_cotrex_DpRdBuff_RegRead(), transaction::parameter, SIZE_WORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), and transaction::uplevel.
Referenced by jtag_arm_ReadWord(), jtag_cortex_core_GetBuff(), and jtag_cortex_core_WriteCpuRegs().
uint32_t jtag_cortex_AHB_ReadHalfword | ( | uint32_t | address | ) |
16 Bit Halfword Read
address | target machine address (memory at ARM side) |
References AUTO_INCR_OFF_AP_CONTROL, jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegRead(), jtag_cotrex_DpRdBuff_RegRead(), transaction::parameter, SIZE_HALFWORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), and transaction::uplevel.
Referenced by jtag_arm_ReadHalfword().
uint32_t jtag_cortex_AHB_ReadByte | ( | uint32_t | address | ) |
8 Bit Byte Read
address | target machine address (memory at ARM side) |
References AUTO_INCR_OFF_AP_CONTROL, jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegRead(), jtag_cotrex_DpRdBuff_RegRead(), transaction::parameter, SIZE_BYTE_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), and transaction::uplevel.
Referenced by jtag_arm_ReadByte(), jtag_cortex_core_GetBuff(), and jtag_cortex_core_PollDbgState().
void jtag_cortex_AHB_WriteMemoryBuf | ( | uint32_t | address, | |
int | howmanywords, | |||
uint32_t * | buf | |||
) |
Write back word memory from the given buffer.
address | target machine address (memory at ARM side) | |
howmanywords | number of words to read | |
buf | pointer to source write buffer (memory at server side) |
References AUTO_INCR_SINGLE_AP_CONTROL, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegWrite(), jtag_eos(), SIZE_WORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transactionPenting(), and transaction::uplevel.
Referenced by jtag_arm_WriteMemoryBuf(), jtag_cortex_core_ReadCpuRegs(), and jtag_test().
void jtag_cortex_AHB_WriteWord | ( | uint32_t | address, | |
uint32_t | value | |||
) |
write single 32-bit data value to address
address | target machine address (memory at ARM side) | |
value | 32 bit value to write |
References AUTO_INCR_OFF_AP_CONTROL, jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegWrite(), jtag_eos(), SIZE_WORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), and transaction::uplevel.
Referenced by jtag_arm_WriteWord(), and jtag_cortex_core_WriteCpuRegs().
void jtag_cortex_AHB_WriteHalfword | ( | uint32_t | address, | |
uint16_t | value | |||
) |
16-bit memory write
address | target machine address (memory at ARM side) | |
value | 16 bit value to write |
References AUTO_INCR_OFF_AP_CONTROL, jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegWrite(), jtag_eos(), SIZE_WORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transactionPenting(), and transaction::uplevel.
Referenced by jtag_arm_WriteHalfword().
void jtag_cortex_AHB_WriteByte | ( | uint32_t | address, | |
uint16_t | value | |||
) |
8-bit memory write
address | target machine address (memory at ARM side) | |
value | 8 bit value to write |
References AUTO_INCR_OFF_AP_CONTROL, jtag_cortex_AHB_setmodeTar(), jtag_cortex_ApAHB_DataRegWrite(), jtag_eos(), SIZE_WORD_AHB_AP_CONTROL, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transactionPenting(), and transaction::uplevel.
Referenced by jtag_arm_WriteByte(), and jtag_cortex_core_PollDbgState().
uint32_t currentAddrIncr = 0 [static] |
Referenced by jtag_cortex_AHB_attach(), and jtag_cortex_AHB_setmodeTar().
uint32_t currentSize = 0 [static] |
Referenced by jtag_cortex_AHB_attach(), and jtag_cortex_AHB_setmodeTar().
uint32_t currentTar = 0xFFFFffff [static] |
Referenced by jtag_cortex_AHB_setmodeTar().