|
|
|
@ -1,6 +1,7 @@
@@ -1,6 +1,7 @@
|
|
|
|
|
#include "AP_InternalError.h" |
|
|
|
|
|
|
|
|
|
#include <AP_BoardConfig/AP_BoardConfig.h> |
|
|
|
|
#include <stdio.h> |
|
|
|
|
|
|
|
|
|
extern const AP_HAL::HAL &hal; |
|
|
|
|
|
|
|
|
@ -56,6 +57,7 @@ void AP_InternalError::errors_as_string(uint8_t *buffer, const uint16_t len) con
@@ -56,6 +57,7 @@ void AP_InternalError::errors_as_string(uint8_t *buffer, const uint16_t len) con
|
|
|
|
|
"stack_ovrflw", // stack_overflow
|
|
|
|
|
"imu_reset", // imu_reset
|
|
|
|
|
"gpio_isr", |
|
|
|
|
"mem_guard", |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static_assert((1U<<(ARRAY_SIZE(error_bit_descriptions))) == uint32_t(AP_InternalError::error_t::__LAST__), "too few descriptions for bits"); |
|
|
|
@ -110,3 +112,13 @@ void AP_stack_overflow(const char *thread_name)
@@ -110,3 +112,13 @@ void AP_stack_overflow(const char *thread_name)
|
|
|
|
|
AP_HAL::panic("stack overflow %s\n", thread_name); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// hook for memory guard errors with --enable-memory-guard
|
|
|
|
|
void AP_memory_guard_error(uint32_t size) |
|
|
|
|
{ |
|
|
|
|
INTERNAL_ERROR(AP_InternalError::error_t::mem_guard); |
|
|
|
|
if (!hal.util->get_soft_armed()) { |
|
|
|
|
::printf("memory guard error size=%u\n", unsigned(size)); |
|
|
|
|
AP_HAL::panic("memory guard size=%u\n", unsigned(size)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|