@@ -168,22 +168,22 @@ static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsign
168
168
current_error_ctx .thread_current_sp = (uint32_t )& current_error_ctx ; // Address local variable to get a stack pointer
169
169
}
170
170
171
- #ifdef MBED_CONF_RTOS_PRESENT
172
171
if (mfc && !(mfc -> EXC_RETURN & 0x4 )) {
173
172
// handler mode
174
173
current_error_ctx .thread_id = 0 ;
175
174
current_error_ctx .thread_entry_address = 0 ;
176
175
current_error_ctx .thread_stack_size = MAX (0 , (int )INITIAL_SP - (int )current_error_ctx .thread_current_sp - (int )sizeof (int ));
177
176
current_error_ctx .thread_stack_mem = current_error_ctx .thread_current_sp ;
178
177
} else {
178
+ #ifdef MBED_CONF_RTOS_PRESENT
179
179
// Capture thread info in thread mode
180
180
osRtxThread_t * current_thread = osRtxInfo .thread .run .curr ;
181
181
current_error_ctx .thread_id = (uint32_t )current_thread ;
182
182
current_error_ctx .thread_entry_address = (uint32_t )current_thread -> thread_addr ;
183
183
current_error_ctx .thread_stack_size = current_thread -> stack_size ;
184
184
current_error_ctx .thread_stack_mem = (uint32_t )current_thread -> stack_mem ;
185
- }
186
185
#endif //MBED_CONF_RTOS_PRESENT
186
+ }
187
187
188
188
#if MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED
189
189
//Capture filename/linenumber if provided
@@ -482,7 +482,7 @@ static inline const char *name_or_unnamed(const osRtxThread_t *thread)
482
482
* @param stack_sp The stack pointer currently at. */
483
483
static void print_stack_dump (uint32_t stack_start , uint32_t stack_size , uint32_t stack_sp )
484
484
{
485
- #if MBED_STACK_DUMP_ENABLED && defined( MBED_CONF_RTOS_PRESENT )
485
+ #if MBED_STACK_DUMP_ENABLED
486
486
#define STACK_DUMP_WIDTH 8
487
487
#define INT_ALIGN_MASK (~(sizeof(int) - 1))
488
488
mbed_error_printf ("\n\nStack Dump:" );
0 commit comments