SingingCat 0
application
boot_info.c
Go to the documentation of this file.
1#include "constants.h"
2#include "boot_info.h"
3#include "main-header.h"
4#include "baseinfo.h"
5#include "function-instr.h"
6
14static const char *get_reset_source_text(int res) {
15 const char *txt = NULL;
16
17 if (res == HAL_RESET_WATCHDOG) {
18 txt = "Watchdog";
19 } else if (res == HAL_RESET_POWER) {
20 txt = "Power";
21 } else if (res == HAL_RESET_SLEEP) {
22 txt = "Sleep/Wakeup";
23 } else if (res == HAL_RESET_FAULT) {
24 txt = "Fault";
25 } else if (res == HAL_RESET_SOFTWARE) {
26 txt = "Software";
27 } else if (res == HAL_RESET_PIN) {
28 txt = "Pin";
29 } else {
30 txt = "Other";
31 }
32 return txt;
33}
38 IPLOG("Application base: %p\r\n", get_app_header());
39 IPLOG("Build # %i\r\n", CNW_BUILD_VERSION);
40 IPLOG("Last PC: %p\r\n", constants()->last_return_address);
41 IPLOG("Failing address: %p\r\n", constants()->failing_address);
42 IPLOG("CFSR: %p\r\n", constants()->CFSR);
43 IPLOG("Reset Source: %p (%s)\r\n", loader_get_last_reset_cause(), get_reset_source_text(loader_get_last_reset_cause()));
44}
void print_boot_info()
print startup information
Definition: boot_info.c:37