[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 07:31:39 +09:00
committed by GitHub
co-authored by Aleksandr Kutuzov
parent 268b88be0d
commit 241b4ef6e4
12 changed files with 205 additions and 22 deletions
+16
View File
@@ -6,6 +6,7 @@
#include <furi_hal_power.h>
#include <furi_hal_rtc.h>
#include <furi_hal_debug.h>
#include <furi_hal_bt.h>
#include <stdio.h>
#include <FreeRTOS.h>
@@ -87,6 +88,20 @@ static void __furi_print_stack_info() {
__furi_put_uint32_as_text(uxTaskGetStackHighWaterMark(NULL) * 4);
}
static void __furi_print_bt_stack_info() {
const FuriHalBtHardfaultInfo* fault_info = furi_hal_bt_get_hardfault_info();
if(fault_info == NULL) {
furi_hal_console_puts("\r\n\tcore2: not faulted");
} else {
furi_hal_console_puts("\r\n\tcore2: hardfaulted.\r\n\tPC: ");
__furi_put_uint32_as_hex(fault_info->source_pc);
furi_hal_console_puts("\r\n\tLR: ");
__furi_put_uint32_as_hex(fault_info->source_lr);
furi_hal_console_puts("\r\n\tSP: ");
__furi_put_uint32_as_hex(fault_info->source_sp);
}
}
static void __furi_print_heap_info() {
furi_hal_console_puts("\r\n\t heap total: ");
__furi_put_uint32_as_text(xPortGetTotalHeapSize());
@@ -136,6 +151,7 @@ FURI_NORETURN void __furi_crash() {
__furi_print_stack_info();
}
__furi_print_heap_info();
__furi_print_bt_stack_info();
#ifndef FURI_DEBUG
// Check if debug enabled by DAP