Skip to content

Commit 7c87117

Browse files
committed
fixup! error: use __INITIAL_SP from cmsis instead of RTX one
1 parent f617643 commit 7c87117

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

platform/source/mbed_error.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsign
6767
static bool is_reboot_error_valid = false;
6868
#endif
6969

70+
extern uint32_t __INITIAL_SP;
71+
7072
//Helper function to halt the system
7173
static MBED_NORETURN void mbed_halt_system(void)
7274
{
@@ -529,16 +531,16 @@ static void print_stack_dump(uint32_t stack_start, uint32_t stack_size, uint32_t
529531
}
530532
#endif // MBED_STACK_DUMP_ENABLED
531533

532-
#if MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO && defined(MBED_CONF_RTOS_PRESENT)
534+
//#if MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO && defined(MBED_CONF_RTOS_PRESENT)
533535
/* Prints info of a thread(using osRtxThread_t struct)*/
534536
static void print_thread(const osRtxThread_t *thread)
535537
{
536538
uint32_t stack_mem = (uint32_t)thread->stack_mem;
537539
mbed_error_printf("\n%s State: 0x%" PRIX8 " Entry: 0x%08" PRIX32 " Stack Size: 0x%08" PRIX32 " Mem: 0x%08" PRIX32 " SP: 0x%08" PRIX32, name_or_unnamed(thread), thread->state, thread->thread_addr, thread->stack_size, stack_mem, thread->sp);
538540

539-
#if MBED_STACK_DUMP_ENABLED
541+
//#if MBED_STACK_DUMP_ENABLED
540542
print_stack_dump(stack_mem, thread->stack_size, thread->sp, NULL);
541-
#endif
543+
//#endif
542544
}
543545

544546
/* Prints thread info from a list */
@@ -549,7 +551,7 @@ static void print_threads_info(const osRtxThread_t *threads)
549551
threads = threads->thread_next;
550552
}
551553
}
552-
#endif
554+
//#endif
553555

554556
#ifndef NDEBUG
555557
#define GET_TARGET_NAME_STR(tgt_name) #tgt_name

0 commit comments

Comments
 (0)