-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDBG_MTB.ini
47 lines (41 loc) · 1.86 KB
/
DBG_MTB.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/******************************************************************************/
/* MTB.ini: Initialization Script for Cortex-M0+ MTB(Micro Trace Buffer) */
/******************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>> //
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2012 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
FUNC void MTB_Setup (void) {
unsigned long position;
unsigned long master;
unsigned long watermark;
unsigned long _flow;
// <e0.31> Trace: MTB (Micro Trace Buffer)
// <o0.0..4> Buffer Size
// <4=> 256B
// <5=> 512B
// <6=> 1kB
// <7=> 2kB
// <8=> 4kB
// <9=> 8kB
// <o1> Buffer Position
// <i> Buffer position in RAM. Must be a multiple of the buffer size.
// <o2.0> Stop Trace when buffer is full
// <o2.1> Stop Target when buffer is full
// </e>
master = 0x80000008;
position = 0x20000000;
_flow = 0x00000000;
position &= 0xFFFFFFF8; // Mask POSITION.POINTER field
watermark = position + ((16 << (master & 0x1F)) - 32);
_flow |= watermark;
_WDWORD(0xF0000004, 0x00000000); // MASTER
_WDWORD(0xF0000000, position); // POSITION
_WDWORD(0xF0000008, _flow); // FLOW
_WDWORD(0xF0000004, master); // MASTER
}
MTB_Setup();