-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is helpful for users to quickly check if they have KV support or not.
- Loading branch information
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Makefile for user application | ||
|
||
# Specify this directory relative to the current application. | ||
TOCK_USERLAND_BASE_DIR = ../../.. | ||
|
||
# Which files to compile. | ||
C_SRCS := $(wildcard *.c) | ||
|
||
# Include userland master makefile. Contains rules and flags for actually | ||
# building the application. | ||
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
KV Check | ||
========= | ||
|
||
This is a simple application to check for the presence of Key-Value support or | ||
not. | ||
|
||
If KV support exists, you should see: | ||
|
||
``` | ||
[KV] Check for Key-Value Support | ||
Key-Value support is enabled. | ||
``` | ||
|
||
and if you have the process console enabled: | ||
|
||
``` | ||
$ tockloader listen | ||
tock$ process kv_check | ||
ππ©π©: kv_check - [Terminated] | ||
Events Queued: 0 Syscall Count: 17 Dropped Upcall Count: 0 | ||
Restart Count: 0 | ||
Last Syscall: Exit { which: 0, completion_code: 0 } | ||
Completion Code: 0 | ||
Credential: None | ||
βββββββββββββ€βββββββββββββββββββββββββββββββββββββββββββ | ||
β Address β Region Name Used | Allocated (bytes) β | ||
β0x2000B000ββͺβββββββββββββββββββββββββββββββββββββββββββ | ||
β Grant Ptrs 128 | ||
β Upcalls 320 | ||
β Process 920 | ||
0x2000AAA8 βΌβββββββββββββββββββββββββββββββββββββββββββ | ||
β βΌ Grant 76 | ||
0x2000AA5C βΌβββββββββββββββββββββββββββββββββββββββββββ | ||
β Unused | ||
0x20009FC8 βΌβββββββββββββββββββββββββββββββββββββββββββ | ||
β β² Heap 1100 | 3808 S | ||
0x20009B7C βΌβββββββββββββββββββββββββββββββββββββββββββ R | ||
β Data 892 | 892 A | ||
0x20009800 βΌβββββββββββββββββββββββββββββββββββββββββββ M | ||
β βΌ Stack 240 | 2048 | ||
0x20009710 βΌβββββββββββββββββββββββββββββββββββββββββββ | ||
β Unused | ||
0x20009000 β΄βββββββββββββββββββββββββββββββββββββββββββ | ||
..... | ||
0x00042000 β¬βββββββββββββββββββββββββββββββββββββββββββ F | ||
β App Flash 8116 L | ||
0x0004004C βΌβββββββββββββββββββββββββββββββββββββββββββ A | ||
β Protected 76 S | ||
0x00040000 β΄βββββββββββββββββββββββββββββββββββββββββββ H | ||
``` | ||
|
||
note that `Completion Code` is zero, meaning KV support exists. If not, the | ||
completion code will be -1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include <console.h> | ||
#include <kv.h> | ||
|
||
int main(void) { | ||
printf("[KV] Check for Key-Value Support\n"); | ||
|
||
if (kv_check_status() == RETURNCODE_SUCCESS) { | ||
printf("Key-Value support is enabled.\n"); | ||
tock_exit(0); | ||
} else { | ||
printf("[ERROR] Key-Value support is NOT enabled.\n"); | ||
tock_exit(-1); | ||
} | ||
|
||
return 0; | ||
} |