|
1 | 1 | from amaranth import * |
2 | 2 | from .dbgIF import DBGIF |
| 3 | +from ..git_version import get_version |
3 | 4 |
|
4 | 5 | # Principle of operation |
5 | 6 | # ====================== |
|
19 | 20 | DAP_CONNECT_DEFAULT = 1 # Default connect is SWD |
20 | 21 | DAP_PROTOCOL_STRING_LEN = 5 |
21 | 22 | DAP_PROTOCOL_STRING = Cat(C(DAP_PROTOCOL_STRING_LEN+1,8),C(ord('2'),8),C(ord('.'),8),C(ord('1'),8),C(ord('.'),8),C(ord('0'),8),C(0,8)) # Protocol version V2.1.0 |
22 | | -DAP_VERSION_STRING_LEN = 4 |
23 | | -DAP_VERSION_STRING = Cat(C(DAP_VERSION_STRING_LEN+1,8),C(0x31,8),C(0x2e,8),C(0x30,8),C(0x30,8),C(0,8)) |
| 23 | +DAP_VERSION_STRING_LEN = len(get_version().encode('utf-8')) |
| 24 | +DAP_VERSION_STRING = Cat(C(DAP_VERSION_STRING_LEN+1,8), *(C(c, 8) for c in get_version().encode('utf-8')), C(0,8)) |
24 | 25 | DAP_CAPABILITIES = 0x03 # JTAG and SWD Debug |
25 | 26 | DAP_TD_TIMER_FREQ = 0x3B9ACA00 # 1uS resolution timer |
26 | 27 | DAP_MAX_PACKET_COUNT = 1 # 1 max packet count |
@@ -164,7 +165,7 @@ def __init__(self, streamIn, streamOut, dbgif, v2Indication): |
164 | 165 | self.rxedLen = Signal(3) # Rxlen picked up so far |
165 | 166 |
|
166 | 167 | # Transmit block construction |
167 | | - self.txBlock = Signal( 14*8 ) # Response to be returned |
| 168 | + self.txBlock = Signal( 32*8 ) # Response to be returned |
168 | 169 | self.txLen = Signal(range(MAX_MSG_LEN)) # Length of response to be returned |
169 | 170 | self.txedLen = Signal(range(MAX_MSG_LEN)) # Length of response that has been returned so far |
170 | 171 | self.busy = Signal() # Indicator that we can't receive stream traffic at the moment |
|
0 commit comments