causeHardFault() function for different ports
This commit is contained in:
parent
db6b9ba5b9
commit
aa7265a5bf
|
@ -138,6 +138,13 @@ void baseMCUInit(void) {
|
||||||
BOR_Set(BOR_Level_1); // one step above default value
|
BOR_Set(BOR_Level_1); // one step above default value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void causeHardFault() {
|
||||||
|
// Set the function pointer to an invalid address
|
||||||
|
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||||
|
// Calling the invalid function will trigger a hard fault
|
||||||
|
invalidFunction();
|
||||||
|
}
|
||||||
|
|
||||||
/* used to detect additional RAM available for LUA
|
/* used to detect additional RAM available for LUA
|
||||||
* TODO: find RAM on AT32
|
* TODO: find RAM on AT32
|
||||||
* TODO: better name */
|
* TODO: better name */
|
||||||
|
|
|
@ -24,6 +24,13 @@ extern "C" {
|
||||||
void baseMCUInit(void) {
|
void baseMCUInit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void causeHardFault() {
|
||||||
|
// Set the function pointer to an invalid address
|
||||||
|
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||||
|
// Calling the invalid function will trigger a hard fault
|
||||||
|
invalidFunction();
|
||||||
|
}
|
||||||
|
|
||||||
void _unhandled_exception(void) {
|
void _unhandled_exception(void) {
|
||||||
/*lint -restore*/
|
/*lint -restore*/
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,13 @@
|
||||||
void baseMCUInit(void) {
|
void baseMCUInit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void causeHardFault() {
|
||||||
|
// Set the function pointer to an invalid address
|
||||||
|
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||||
|
// Calling the invalid function will trigger a hard fault
|
||||||
|
invalidFunction();
|
||||||
|
}
|
||||||
|
|
||||||
void _unhandled_exception(void) {
|
void _unhandled_exception(void) {
|
||||||
/*lint -restore*/
|
/*lint -restore*/
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ void jump_to_bootloader();
|
||||||
#if EFI_USE_OPENBLT
|
#if EFI_USE_OPENBLT
|
||||||
void jump_to_openblt();
|
void jump_to_openblt();
|
||||||
#endif
|
#endif
|
||||||
|
void causeHardFault();
|
||||||
bool allowFlashWhileRunning();
|
bool allowFlashWhileRunning();
|
||||||
|
|
||||||
bool ramReadProbe(volatile const char *read_address);
|
bool ramReadProbe(volatile const char *read_address);
|
||||||
|
|
|
@ -110,6 +110,15 @@ void baseMCUInit(void) {
|
||||||
BOR_Set(BOR_Level_1); // one step above default value
|
BOR_Set(BOR_Level_1); // one step above default value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void causeHardFault() {
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
// Set the function pointer to an invalid address
|
||||||
|
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||||
|
// Calling the invalid function will trigger a hard fault
|
||||||
|
invalidFunction();
|
||||||
|
#endif /* EFI_PROD_CODE */
|
||||||
|
}
|
||||||
|
|
||||||
extern uint32_t __main_stack_base__;
|
extern uint32_t __main_stack_base__;
|
||||||
|
|
||||||
typedef struct port_intctx intctx_t;
|
typedef struct port_intctx intctx_t;
|
||||||
|
|
|
@ -7,3 +7,4 @@ static bool isValidCanRxPin(brain_pin_e) { return true; }
|
||||||
#endif // HAL_USE_CAN
|
#endif // HAL_USE_CAN
|
||||||
|
|
||||||
static bool allowFlashWhileRunning() { return true; }
|
static bool allowFlashWhileRunning() { return true; }
|
||||||
|
static void causeHardFault() { }
|
||||||
|
|
Loading…
Reference in New Issue