Skip to content

Commit ea27344

Browse files
authored
Merge pull request #492 from orenc17A/debug_box_docs
Add debug box reference implementation link to docs
2 parents 2a3d08f + 029ce64 commit ea27344

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

docs/lib/DEBUGGING.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -127,56 +127,7 @@ The debug handler — `halt_error` — only executes once, so if another fault o
127127

128128
Debug box handlers can also reset the device by calling the `NVIC_SystemReset()` API. This API cannot be called from other secure boxes.
129129

130-
```C
131-
typedef struct TUvisorDebugDriver {
132-
uint32_t (*get_version)(void); /* 0. Return the implemented driver version. */
133-
void (*halt_error)(int); /* 1. Halt on error. Halt upon return. */
134-
}
135-
```
136-
137-
This is an example of how to implement and configure a debug box.
138-
139-
```C
140-
#include "mbed.h"
141-
#include "uvisor-lib/uvisor-lib.h"
142-
143-
static const UvisorBoxAclItem acl[] = {
144-
/* No specific ACL required. */
145-
};
146-
147-
static void box_debug_main(const void *);
148-
149-
/* Configure the debug box. */
150-
UVISOR_BOX_NAMESPACE(NULL);
151-
UVISOR_BOX_HEAPSIZE(2048);
152-
UVISOR_BOX_MAIN(box_debug_main, osPriorityNormal, 1024);
153-
UVISOR_BOX_CONFIG(box_debug, 1024);
154-
155-
static uint32_t get_version(void) {
156-
return 0;
157-
}
158-
159-
static void halt_error(int reason) {
160-
printf("We halted with reason %i\r\n", reason);
161-
162-
/* If we don't do anything, the system will halt upon return. */
163-
/* A debug box handler such as this one can also decide to reboot the whole
164-
* system. This is only allowed from the debug box. */
165-
NVIC_SystemReset();
166-
}
167-
168-
static void box_debug_main(const void *)
169-
{
170-
/* Debug box driver -- Version 0 */
171-
static const TUvisorDebugDriver driver = {
172-
get_version,
173-
halt_error
174-
};
175-
176-
/* Register the debug box with uVisor. */
177-
uvisor_debug_init(&driver);
178-
}
179-
```
130+
For a reference implementation of a debug box please refer to [mbed-os-example-uvisor-debug-fault repository](https://github.com/ARMmbed/mbed-os-example-uvisor-debug-fault)
180131

181132
## Platform-specific details
182133

0 commit comments

Comments
 (0)