Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix small size of crash dumps #230

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/common/crashdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CrashCatcherMemoryRegion* CrashCatcher_GetMemoryRegions(void);
const CrashCatcherMemoryRegion* CrashCatcher_GetMemoryRegions(void)
{
// do a full dump if on serial
static CrashCatcherMemoryRegion regions[60] = {
static CrashCatcherMemoryRegion regions[80] = {
{(uint32_t)&__ram0_start__, (uint32_t)&__ram0_end__, CRASH_CATCHER_BYTE},
{(uint32_t)&ch_system, (uint32_t)&ch_system + sizeof(ch_system), CRASH_CATCHER_BYTE}};
uint32_t total_dump_size = dump_size + buf_off + REMAINDER_MEM_REGION_SIZE;
Expand Down Expand Up @@ -138,7 +138,7 @@ const CrashCatcherMemoryRegion* CrashCatcher_GetMemoryRegions(void)
// log statically alocated memory
int32_t bss_size = ((uint32_t)&__bss_end__) - ((uint32_t)&__bss_base__);
int32_t available_space = stm32_crash_dump_max_size() - total_dump_size;
if (available_space < 0) {
if (available_space < 0 || curr_region >= (ARRAY_SIZE(regions) - 1)) {
// we can't log anymore than this
goto finalise;
}
Expand All @@ -157,7 +157,7 @@ const CrashCatcherMemoryRegion* CrashCatcher_GetMemoryRegions(void)
// dump the Heap as well as much as we can
int32_t heap_size = ((uint32_t)&__heap_end__) - ((uint32_t)&__heap_base__);
available_space = stm32_crash_dump_max_size() - total_dump_size;
if (available_space < 0) {
if (available_space < 0 || curr_region >= (ARRAY_SIZE(regions) - 1)) {
// we can't log anymore than this
goto finalise;
}
Expand Down
Loading