Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.

Upstream: https://github.com/ARMmbed/DAPLink

Committer:
Pawel Zarembski
Date:
Tue Apr 07 12:55:42 2020 +0200
Revision:
0:01f31e923fe2
hani: DAPLink with reset workaround

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pawel Zarembski 0:01f31e923fe2 1 /**
Pawel Zarembski 0:01f31e923fe2 2 * @file debug_ca.h
Pawel Zarembski 0:01f31e923fe2 3 * @brief Access to ARM DAP (Cortex-A) using CMSIS-DAP protocol
Pawel Zarembski 0:01f31e923fe2 4 *
Pawel Zarembski 0:01f31e923fe2 5 * DAPLink Interface Firmware
Pawel Zarembski 0:01f31e923fe2 6 * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Pawel Zarembski 0:01f31e923fe2 7 * SPDX-License-Identifier: Apache-2.0
Pawel Zarembski 0:01f31e923fe2 8 *
Pawel Zarembski 0:01f31e923fe2 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
Pawel Zarembski 0:01f31e923fe2 10 * not use this file except in compliance with the License.
Pawel Zarembski 0:01f31e923fe2 11 * You may obtain a copy of the License at
Pawel Zarembski 0:01f31e923fe2 12 *
Pawel Zarembski 0:01f31e923fe2 13 * http://www.apache.org/licenses/LICENSE-2.0
Pawel Zarembski 0:01f31e923fe2 14 *
Pawel Zarembski 0:01f31e923fe2 15 * Unless required by applicable law or agreed to in writing, software
Pawel Zarembski 0:01f31e923fe2 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Pawel Zarembski 0:01f31e923fe2 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Pawel Zarembski 0:01f31e923fe2 18 * See the License for the specific language governing permissions and
Pawel Zarembski 0:01f31e923fe2 19 * limitations under the License.
Pawel Zarembski 0:01f31e923fe2 20 */
Pawel Zarembski 0:01f31e923fe2 21
Pawel Zarembski 0:01f31e923fe2 22 #ifndef DEBUG_CA_H
Pawel Zarembski 0:01f31e923fe2 23 #define DEBUG_CA_H
Pawel Zarembski 0:01f31e923fe2 24
Pawel Zarembski 0:01f31e923fe2 25 #include "debug_cm.h"
Pawel Zarembski 0:01f31e923fe2 26
Pawel Zarembski 0:01f31e923fe2 27 // Debug registers
Pawel Zarembski 0:01f31e923fe2 28 #define DEBUG_REGSITER_BASE (0x80030000)
Pawel Zarembski 0:01f31e923fe2 29
Pawel Zarembski 0:01f31e923fe2 30 #define DBGDIDR (DEBUG_REGSITER_BASE + (0 * 4)) // Debug ID
Pawel Zarembski 0:01f31e923fe2 31 #define DBGWFAR (DEBUG_REGSITER_BASE + (6 * 4)) // Watchpoint Fault Address
Pawel Zarembski 0:01f31e923fe2 32 #define DBGVCR (DEBUG_REGSITER_BASE + (7 * 4)) // Vector Catch
Pawel Zarembski 0:01f31e923fe2 33 #define DBGECR (DEBUG_REGSITER_BASE + (9 * 4)) // Event Catch
Pawel Zarembski 0:01f31e923fe2 34 #define DBGDTRRX (DEBUG_REGSITER_BASE + (32 * 4)) // Host to Target Data Transfer
Pawel Zarembski 0:01f31e923fe2 35 #define DBGITR (DEBUG_REGSITER_BASE + (33 * 4)) // WO Instruction Transfer
Pawel Zarembski 0:01f31e923fe2 36 #define DBGDSCR (DEBUG_REGSITER_BASE + (34 * 4)) // Debug Status and Control
Pawel Zarembski 0:01f31e923fe2 37 #define DBGDTRTX (DEBUG_REGSITER_BASE + (35 * 4)) // Target to Host Data Transfer
Pawel Zarembski 0:01f31e923fe2 38 #define DBGDRCR (DEBUG_REGSITER_BASE + (36 * 4)) // Debug Run Control
Pawel Zarembski 0:01f31e923fe2 39 #define DBGEACR (DEBUG_REGSITER_BASE + (37 * 4)) // External Auxiliary Control
Pawel Zarembski 0:01f31e923fe2 40 #define DBGPCSR (DEBUG_REGSITER_BASE + (40 * 4)) // Program Counter Sampling
Pawel Zarembski 0:01f31e923fe2 41 #define DBGCIDSR (DEBUG_REGSITER_BASE + (41 * 4)) // Context ID Sampling
Pawel Zarembski 0:01f31e923fe2 42 #define DBGVIDSR (DEBUG_REGSITER_BASE + (42 * 4)) // Virtualization ID Sampling
Pawel Zarembski 0:01f31e923fe2 43 #define DBGBVR0 (DEBUG_REGSITER_BASE + (64 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 44 #define DBGBVR1 (DEBUG_REGSITER_BASE + (65 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 45 #define DBGBVR2 (DEBUG_REGSITER_BASE + (66 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 46 #define DBGBVR3 (DEBUG_REGSITER_BASE + (67 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 47 #define DBGBVR4 (DEBUG_REGSITER_BASE + (68 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 48 #define DBGBVR5 (DEBUG_REGSITER_BASE + (69 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 49 #define DBGBVR6 (DEBUG_REGSITER_BASE + (70 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 50 #define DBGBVR7 (DEBUG_REGSITER_BASE + (71 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 51 #define DBGBVR8 (DEBUG_REGSITER_BASE + (72 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 52 #define DBGBVR9 (DEBUG_REGSITER_BASE + (73 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 53 #define DBGBVR10 (DEBUG_REGSITER_BASE + (74 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 54 #define DBGBVR11 (DEBUG_REGSITER_BASE + (75 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 55 #define DBGBVR12 (DEBUG_REGSITER_BASE + (76 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 56 #define DBGBVR13 (DEBUG_REGSITER_BASE + (77 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 57 #define DBGBVR14 (DEBUG_REGSITER_BASE + (78 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 58 #define DBGBVR15 (DEBUG_REGSITER_BASE + (79 * 4)) // Breakpoint Value
Pawel Zarembski 0:01f31e923fe2 59 #define DBGBCR0 (DEBUG_REGSITER_BASE + (80 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 60 #define DBGBCR1 (DEBUG_REGSITER_BASE + (81 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 61 #define DBGBCR2 (DEBUG_REGSITER_BASE + (82 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 62 #define DBGBCR3 (DEBUG_REGSITER_BASE + (83 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 63 #define DBGBCR4 (DEBUG_REGSITER_BASE + (84 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 64 #define DBGBCR5 (DEBUG_REGSITER_BASE + (85 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 65 #define DBGBCR6 (DEBUG_REGSITER_BASE + (86 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 66 #define DBGBCR7 (DEBUG_REGSITER_BASE + (87 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 67 #define DBGBCR8 (DEBUG_REGSITER_BASE + (88 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 68 #define DBGBCR9 (DEBUG_REGSITER_BASE + (89 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 69 #define DBGBCR10 (DEBUG_REGSITER_BASE + (90 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 70 #define DBGBCR11 (DEBUG_REGSITER_BASE + (91 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 71 #define DBGBCR12 (DEBUG_REGSITER_BASE + (92 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 72 #define DBGBCR13 (DEBUG_REGSITER_BASE + (93 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 73 #define DBGBCR14 (DEBUG_REGSITER_BASE + (94 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 74 #define DBGBCR15 (DEBUG_REGSITER_BASE + (95 * 4)) // Breakpoint Control
Pawel Zarembski 0:01f31e923fe2 75 #define DBGWVR0 (DEBUG_REGSITER_BASE + (96 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 76 #define DBGWVR1 (DEBUG_REGSITER_BASE + (97 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 77 #define DBGWVR2 (DEBUG_REGSITER_BASE + (98 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 78 #define DBGWVR3 (DEBUG_REGSITER_BASE + (99 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 79 #define DBGWVR4 (DEBUG_REGSITER_BASE + (100 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 80 #define DBGWVR5 (DEBUG_REGSITER_BASE + (101 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 81 #define DBGWVR6 (DEBUG_REGSITER_BASE + (102 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 82 #define DBGWVR7 (DEBUG_REGSITER_BASE + (103 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 83 #define DBGWVR8 (DEBUG_REGSITER_BASE + (104 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 84 #define DBGWVR9 (DEBUG_REGSITER_BASE + (105 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 85 #define DBGWVR10 (DEBUG_REGSITER_BASE + (106 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 86 #define DBGWVR11 (DEBUG_REGSITER_BASE + (107 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 87 #define DBGWVR12 (DEBUG_REGSITER_BASE + (108 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 88 #define DBGWVR13 (DEBUG_REGSITER_BASE + (109 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 89 #define DBGWVR14 (DEBUG_REGSITER_BASE + (110 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 90 #define DBGWVR15 (DEBUG_REGSITER_BASE + (111 * 4)) // Watchpoint Value
Pawel Zarembski 0:01f31e923fe2 91 #define DBGWCR0 (DEBUG_REGSITER_BASE + (112 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 92 #define DBGWCR1 (DEBUG_REGSITER_BASE + (113 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 93 #define DBGWCR2 (DEBUG_REGSITER_BASE + (114 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 94 #define DBGWCR3 (DEBUG_REGSITER_BASE + (115 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 95 #define DBGWCR4 (DEBUG_REGSITER_BASE + (116 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 96 #define DBGWCR5 (DEBUG_REGSITER_BASE + (117 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 97 #define DBGWCR6 (DEBUG_REGSITER_BASE + (118 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 98 #define DBGWCR7 (DEBUG_REGSITER_BASE + (119 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 99 #define DBGWCR8 (DEBUG_REGSITER_BASE + (120 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 100 #define DBGWCR9 (DEBUG_REGSITER_BASE + (121 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 101 #define DBGWCR10 (DEBUG_REGSITER_BASE + (122 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 102 #define DBGWCR11 (DEBUG_REGSITER_BASE + (123 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 103 #define DBGWCR12 (DEBUG_REGSITER_BASE + (124 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 104 #define DBGWCR13 (DEBUG_REGSITER_BASE + (125 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 105 #define DBGWCR14 (DEBUG_REGSITER_BASE + (126 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 106 #define DBGWCR15 (DEBUG_REGSITER_BASE + (127 * 4)) // Watchpoint Control
Pawel Zarembski 0:01f31e923fe2 107 #define DBGBXVR0 (DEBUG_REGSITER_BASE + (144 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 108 #define DBGBXVR1 (DEBUG_REGSITER_BASE + (145 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 109 #define DBGBXVR2 (DEBUG_REGSITER_BASE + (146 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 110 #define DBGBXVR3 (DEBUG_REGSITER_BASE + (147 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 111 #define DBGBXVR4 (DEBUG_REGSITER_BASE + (148 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 112 #define DBGBXVR5 (DEBUG_REGSITER_BASE + (149 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 113 #define DBGBXVR6 (DEBUG_REGSITER_BASE + (150 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 114 #define DBGBXVR7 (DEBUG_REGSITER_BASE + (151 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 115 #define DBGBXVR8 (DEBUG_REGSITER_BASE + (152 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 116 #define DBGBXVR9 (DEBUG_REGSITER_BASE + (153 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 117 #define DBGBXVR10 (DEBUG_REGSITER_BASE + (154 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 118 #define DBGBXVR11 (DEBUG_REGSITER_BASE + (155 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 119 #define DBGBXVR12 (DEBUG_REGSITER_BASE + (156 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 120 #define DBGBXVR13 (DEBUG_REGSITER_BASE + (157 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 121 #define DBGBXVR14 (DEBUG_REGSITER_BASE + (158 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 122 #define DBGBXVR15 (DEBUG_REGSITER_BASE + (159 * 4)) // Breakpoint Extended Valueb
Pawel Zarembski 0:01f31e923fe2 123 #define DBGOSLAR (DEBUG_REGSITER_BASE + (192 * 4)) // OS Lock Access
Pawel Zarembski 0:01f31e923fe2 124 #define DBGOSLSR (DEBUG_REGSITER_BASE + (193 * 4)) // OS Lock Status
Pawel Zarembski 0:01f31e923fe2 125 #define DBGPRCR (DEBUG_REGSITER_BASE + (196 * 4)) // Powerdown and Reset Control
Pawel Zarembski 0:01f31e923fe2 126 #define DBGPRSR (DEBUG_REGSITER_BASE + (197 * 4)) // Powerdown and Reset Status
Pawel Zarembski 0:01f31e923fe2 127 #define DBGITCTRL (DEBUG_REGSITER_BASE + (960 * 4)) // Integration Mode Control
Pawel Zarembski 0:01f31e923fe2 128 #define DBGCLAIMSET (DEBUG_REGSITER_BASE + (1000 * 4)) // Claim Tag Set
Pawel Zarembski 0:01f31e923fe2 129 #define DBGCLAIMCLR (DEBUG_REGSITER_BASE + (1001 * 4)) // Claim Tag Clear
Pawel Zarembski 0:01f31e923fe2 130 #define DBGLAR (DEBUG_REGSITER_BASE + (1004 * 4)) // Lock Access
Pawel Zarembski 0:01f31e923fe2 131 #define DBGLSR (DEBUG_REGSITER_BASE + (1005 * 4)) // Lock Status
Pawel Zarembski 0:01f31e923fe2 132 #define DBGAUTHSTATUS (DEBUG_REGSITER_BASE + (1006 * 4)) // Authentication Status
Pawel Zarembski 0:01f31e923fe2 133 #define DBGDEVID2 (DEBUG_REGSITER_BASE + (1008 * 4)) // Debug Device ID 2
Pawel Zarembski 0:01f31e923fe2 134 #define DBGDEVID1 (DEBUG_REGSITER_BASE + (1009 * 4)) // Debug Device ID 1
Pawel Zarembski 0:01f31e923fe2 135 #define DBGDEVID (DEBUG_REGSITER_BASE + (1010 * 4)) // Debug Device ID
Pawel Zarembski 0:01f31e923fe2 136 #define DBGDEVTYPE (DEBUG_REGSITER_BASE + (1011 * 4)) // Device Type
Pawel Zarembski 0:01f31e923fe2 137 #define DBGPID0 (DEBUG_REGSITER_BASE + (1012 * 4)) // Debug Peripheral ID
Pawel Zarembski 0:01f31e923fe2 138 #define DBGPID1 (DEBUG_REGSITER_BASE + (1013 * 4)) // Debug Peripheral ID
Pawel Zarembski 0:01f31e923fe2 139 #define DBGPID2 (DEBUG_REGSITER_BASE + (1014 * 4)) // Debug Peripheral ID
Pawel Zarembski 0:01f31e923fe2 140 #define DBGPID3 (DEBUG_REGSITER_BASE + (1015 * 4)) // Debug Peripheral ID
Pawel Zarembski 0:01f31e923fe2 141 #define DBGPID4 (DEBUG_REGSITER_BASE + (1016 * 4)) // Debug Peripheral ID
Pawel Zarembski 0:01f31e923fe2 142 #define DBGCID0 (DEBUG_REGSITER_BASE + (1020 * 4)) // Debug Component ID
Pawel Zarembski 0:01f31e923fe2 143 #define DBGCID1 (DEBUG_REGSITER_BASE + (1021 * 4)) // Debug Component ID
Pawel Zarembski 0:01f31e923fe2 144 #define DBGCID2 (DEBUG_REGSITER_BASE + (1022 * 4)) // Debug Component ID
Pawel Zarembski 0:01f31e923fe2 145 #define DBGCID3 (DEBUG_REGSITER_BASE + (1023 * 4)) // Debug Component ID
Pawel Zarembski 0:01f31e923fe2 146
Pawel Zarembski 0:01f31e923fe2 147 #endif