Merge pull request #11272 from andrewc-arm/pr_mbed_fault_context01

mbed fault handler: fix mbed_fault_context parameter
pull/11307/head
Martin Kojtal 2019-08-23 10:20:39 +02:00 committed by GitHub
commit 2c3ce9629e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 6 deletions

View File

@ -150,7 +150,8 @@ Fault_Handler_Continue2
MRS R2,CONTROL ; Get CONTROL Reg
STR R2,[R1]
MOV R0,R12
LDR R1,=mbed_fault_context
LDR R3,=mbed_fault_context
LDR R1,[R3]
BL mbed_fault_handler
#endif
B . ; Just in case we come back here

View File

@ -183,7 +183,8 @@ Fault_Handler_Continue2:
MRS R2,CONTROL // Get CONTROL Reg
STR R2,[R1]
MOV R0,R12
LDR R1,=mbed_fault_context
LDR R3,=mbed_fault_context
LDR R1,[R3]
BL mbed_fault_handler
#endif
B . // Just in case we come back here

View File

@ -145,7 +145,8 @@ Fault_Handler_Continue2
MRS R2,CONTROL ; Get CONTROL Reg
STR R2,[R1]
MOV R0,R12
LDR R1,=mbed_fault_context
LDR R3,=mbed_fault_context
LDR R1,[R3]
BL mbed_fault_handler
#endif
B . ; Just in case we come back here

View File

@ -36,12 +36,12 @@ void print_context_info(void);
mbed_fault_context_t *const mbed_fault_context = (mbed_fault_context_t *)(FAULT_CONTEXT_LOCATION);
#else
mbed_fault_context_t fault_context;
mbed_fault_context_t *const mbed_fault_context = (mbed_fault_context_t *) &fault_context;
mbed_fault_context_t *const mbed_fault_context = &fault_context;
#endif
//This is a handler function called from Fault handler to print the error information out.
//This runs in fault context and uses special functions(defined in mbed_rtx_fault_handler.c) to print the information without using C-lib support.
void mbed_fault_handler(uint32_t fault_type, void *mbed_fault_context_in)
void mbed_fault_handler(uint32_t fault_type, const mbed_fault_context_t *mbed_fault_context_in)
{
mbed_error_status_t faultStatus = MBED_SUCCESS;

View File

@ -57,7 +57,7 @@ typedef struct {
//This is a handler function called from Fault handler to print the error information out.
//This runs in fault context and uses special functions(defined in mbed_fault_handler.c) to print the information without using C-lib support.
void mbed_fault_handler(uint32_t fault_type, void *mbed_fault_context_in);
void mbed_fault_handler(uint32_t fault_type, const mbed_fault_context_t *mbed_fault_context_in);
/**
* Call this function to retrieve the fault context after a fatal exception which triggered a system reboot. The function retrieves the fault context stored in crash-report ram area which is preserved over reboot.