Skip to content

Commit b1f01f5

Browse files
committed
Merge branch 'bugfix/abort_log_error_v3.0' into 'release/v3.0'
newlib: fix abort function cause critical error (backport v3.0) See merge request sdk/ESP8266_RTOS_SDK!1203
2 parents 8ac8906 + 3646993 commit b1f01f5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

components/freertos/port/esp8266/include/freertos/portmacro.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ void PortEnableInt_NoNest( void );
167167
#define portENTER_CRITICAL() vPortEnterCritical()
168168
#define portEXIT_CRITICAL() vPortExitCritical()
169169

170+
#define xPortGetCoreID() 0
171+
170172
// no need to disable/enable lvl1 isr again in ISR
171173
//#define portSET_INTERRUPT_MASK_FROM_ISR() PortDisableInt_NoNest()
172174
//#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) PortEnableInt_NoNest()

components/newlib/newlib/port/syscall.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ void _exit(int status)
135135

136136
void abort(void)
137137
{
138-
ESP_LOGE("ABORT","Error found and abort!");
139-
while(1);
138+
ets_printf("abort() was called at PC %p on core %d\r\n", __builtin_return_address(0) - 3, xPortGetCoreID());
139+
140+
/* cause a exception to jump into panic function */
141+
while (1) {
142+
*((int *)NULL) = 0;
143+
}
140144
}

0 commit comments

Comments
 (0)