[FL-3299] furi_crash: added C2 status; added fw-version gdb command (#2638)

* furi_crash: added C2 status
* debug: Added "fw-version" gdb command; vscode: updated configuration to use new command
* debug: added fw-info command to debug_other session
* Toolbox: versioned structure for Version
* debug: fw-version: no longer needs an ELF file loaded
* debug: flipperversion: removed unused variable
* debug_other: print running fw version

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
hedger
2023-05-09 01:31:39 +03:00
committed by GitHub
parent 268b88be0d
commit 241b4ef6e4
12 changed files with 205 additions and 22 deletions
+16 -4
View File
@@ -1,23 +1,34 @@
#include "version.h"
#include <furi.h>
/* This header is autogenerated by build system */
#include "version.inc.h"
#define VERSION_MAGIC (0xBE40u)
#define VERSION_MAJOR (0x1u)
#define VERSION_MINOR (0x0u)
struct Version {
// Header
const uint16_t magic;
const uint8_t major;
const uint8_t minor;
// Payload
const char* git_hash;
const char* git_branch;
const char* git_branch_num;
const char* build_date;
const char* version;
// Payload bits and pieces
const uint8_t target;
const bool build_is_dirty;
};
/* version of current running firmware (bootloader/flipper) */
static const Version version = {
.magic = VERSION_MAGIC,
.major = VERSION_MAJOR,
.minor = VERSION_MINOR,
.git_hash = GIT_COMMIT,
.git_branch = GIT_BRANCH,
.git_branch_num = GIT_BRANCH_NUM,
.build_date = BUILD_DATE,
.version = VERSION
#ifdef FURI_RAM_EXEC
@@ -41,7 +52,8 @@ const char* version_get_gitbranch(const Version* v) {
}
const char* version_get_gitbranchnum(const Version* v) {
return v ? v->git_branch_num : version.git_branch_num;
UNUSED(v);
return "0";
}
const char* version_get_builddate(const Version* v) {