Add save log function and API for rmt debug info

This commit is contained in:
gengyuchao
2020-07-10 02:48:11 +08:00
committed by maojianxin
parent d3fb83421c
commit f51a055736
3 changed files with 12 additions and 4 deletions

View File

@@ -1408,7 +1408,7 @@ esp_err_t esp_ble_scan_dupilcate_list_flush(void)
return ESP_OK;
}
void IRAM_ATTR r_assert_with_log(uint32_t error_bit, uint32_t time_slot)
void IRAM_ATTR __attribute__((noinline)) r_assert_with_log(uint32_t error_bit, uint32_t time_slot)
{
__asm__ __volatile__("ill\n");
}
@@ -1418,7 +1418,7 @@ void IRAM_ATTR r_assert_with_log(uint32_t error_bit, uint32_t time_slot)
*
* After coredump fixing this issue, just delete this function.
*/
void IRAM_ATTR r_assert(const char *condition, int param0, int param1, const char *file, int line)
void IRAM_ATTR __attribute__((noinline)) r_assert(const char *condition, int param0, int param1, const char *file, int line)
{
extern uint32_t btdm_debug_error_get_bit();
extern uint32_t btdm_debug_error_get_time();
@@ -1438,7 +1438,6 @@ extern uint32_t real_bt_isr_count ;
extern uint32_t connection_LinkSuperTimeout;
extern uint32_t bt_isr_count_arry[16];
static bool check_bt_is_alive()
{
static int stop_times = 0;
@@ -1467,6 +1466,7 @@ void esp_bt_check_need_restart()
if(connection_is_alive() && (check_bt_is_alive()==false))
{
ets_printf("!! Check BT is not alive. Abort !!");
RMT_DBG_LOG_ERROR("BT not alive");
abort();
}
}

View File

@@ -462,6 +462,14 @@ esp_err_t esp_ble_scan_dupilcate_list_flush(void);
void esp_bt_check_need_restart();
extern uint32_t* btdm_rmt_get_dbg_log_addr();
extern uint32_t* btdm_rmt_get_fixed_log_addr();
int btdm_rmt_dbg_printf_to_iram(const char* format, ...);
#define RMT_DBG_LOG_ERROR(format, ... ) btdm_rmt_dbg_printf_to_iram(DRAM_STR("E(%d):"format"\n"),esp_log_timestamp(), ##__VA_ARGS__);
#define RMT_DBG_LOG_DEBUG(format, ... ) btdm_rmt_dbg_printf_to_iram(DRAM_STR("D(%d):"format"\n"),esp_log_timestamp(), ##__VA_ARGS__);
#ifdef __cplusplus
}
#endif