Datasheet
This will give you something resembling the following output:
If you don't have names enabled via STATS_NAME_ENABLE you would see something like this:
newtmgr Access
You can also access stats through newtmgr as follows:
Example: Adding Stats to apps/first/src/main.c
You can extend apps/first with custom stats by updating apps/first/src/main.c with the following code:
12274:attempt_stat: 3
12275:error_stat: 0
stat my_stats
29149:s0: 3
29150:s1: 0
$ newtmgr -c serial1 stat my_stats
Return Code = 0
Stats Name: my_stats
attempt_stat: 0
error_stat: 0
#include <assert.h>
#include <string.h>
#include "os/os.h"
#include "bsp/bsp.h"
#include "hal/hal_gpio.h"
#include "sysinit/sysinit.h"
#include "console/console.h"
#include "shell/shell.h"
#include "stats/stats.h"
/* Define task stack and task object */
#define LED_TASK_PRIO (100) /* 1 = highest, 255 = lowest */
#define LED_STACK_SIZE OS_STACK_ALIGN(64)
struct os_task led_task;
os_stack_t led_task_stack[LED_STACK_SIZE];
/* LED task handler prototype declaration */
static void led_task_func(void *arg);
/* Command handler prototype declaration */
static int shell_test_cmd(int argc, char **argv);
/* Shell command struct */
static struct shell_cmd shell_test_cmd_struct = {
.sc_cmd = "test",
.sc_cmd_func = shell_test_cmd
};
© Adafruit Industries https://learn.adafruit.com/adafruit-nrf52-pro-feather Page 65 of 87










