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
This commit is contained in:
Dong Heng
2019-11-29 15:29:15 +08:00
2 changed files with 8 additions and 2 deletions

View File

@@ -167,6 +167,8 @@ void PortEnableInt_NoNest( void );
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
#define xPortGetCoreID() 0
// no need to disable/enable lvl1 isr again in ISR
//#define portSET_INTERRUPT_MASK_FROM_ISR() PortDisableInt_NoNest()
//#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) PortEnableInt_NoNest()

View File

@@ -135,6 +135,10 @@ void _exit(int status)
void abort(void)
{
ESP_LOGE("ABORT","Error found and abort!");
while(1);
ets_printf("abort() was called at PC %p on core %d\r\n", __builtin_return_address(0) - 3, xPortGetCoreID());
/* cause a exception to jump into panic function */
while (1) {
*((int *)NULL) = 0;
}
}