fix: dump crash log without usb plugged, bump release log to INFO (#1332)

## Summary

Follow-up
https://github.com/crosspoint-reader/crosspoint-reader/pull/1145

- Fix log not being record without USB connected
- Bump release log to INFO for more logging details

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? **NO**

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Xuan-Son Nguyen
2026-03-06 22:05:23 +01:00
committed by GitHub
parent 4d22256745
commit c40e92e4d1
4 changed files with 4 additions and 13 deletions

View File

@@ -20,9 +20,6 @@ void addToLogRingBuffer(const char* message) {
// This logPrintf prepend the timestamp, level and origin to the user-provided message, so that the user only needs to
// provide the format string for the message itself.
void logPrintf(const char* level, const char* origin, const char* format, ...) {
if (!logSerial) {
return; // Serial not initialized, skip logging
}
va_list args;
va_start(args, format);
char buf[MAX_ENTRY_LEN];

View File

@@ -17,6 +17,9 @@ RTC_NOINIT_ATTR HalSystem::StackFrame panicStack[MAX_PANIC_STACK_DEPTH];
extern "C" {
void __real_panic_abort(const char* message);
void __real_panic_print_backtrace(const void* frame, int core);
static DRAM_ATTR const char PANIC_REASON_UNKNOWN[] = "(unknown panic reason)";
void IRAM_ATTR __wrap_panic_abort(const char* message) {
if (!message) message = PANIC_REASON_UNKNOWN;

View File

@@ -3,15 +3,6 @@
#include <cstdint>
#include <string>
extern "C" {
void __real_panic_abort(const char* message);
void __wrap_panic_abort(const char* message);
void __real_panic_print_backtrace(const void* frame, int core);
void __wrap_panic_print_backtrace(const void* frame, int core);
}
namespace HalSystem {
struct StackFrame {
uint32_t sp;

View File

@@ -78,7 +78,7 @@ build_flags =
${base.build_flags}
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=0 ; Set log level to error for release builds
-DLOG_LEVEL=1 ; Set log level to info for release builds
[env:gh_release_rc]
extends = base