Skip to content

Commit

Permalink
Merge pull request #3 from Guozhanxin/master
Browse files Browse the repository at this point in the history
Different addresses are offset by different compilers
  • Loading branch information
armink authored Aug 29, 2018
2 parents 55523a5 + 65aad36 commit 0847424
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmb_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ RT_WEAK rt_err_t exception_hook(void *context) {
#endif

/* the PSP is changed by RT-Thread HardFault_Handler, so restore it to HardFault context */
#if (defined (__VFP_FP__) && !defined(__SOFTFP__)) || (defined (__ARMVFP__)) || (defined(__ARM_PCS_VFP) || defined(__TARGET_FPU_VFP))
cmb_set_psp(cmb_get_psp() + 4 * 10);
#else
cmb_set_psp(cmb_get_psp() + 4 * 9);
#endif

cm_backtrace_fault(*((uint32_t *)(cmb_get_sp() + sizeof(uint32_t) * CMB_LR_WORD_OFFSET)), cmb_get_sp() + sizeof(uint32_t) * CMB_SP_WORD_OFFSET);

Expand Down

0 comments on commit 0847424

Please sign in to comment.