mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
espcoredump: Add support for esp32c2
This commit puts some code under SOC_RTC_MEM_SUPPORTED. This enables use of coredump in targets with no RTC memory support.
This commit is contained in:
parent
45fb699542
commit
8fba04638b
@ -22,8 +22,10 @@ extern "C" {
|
||||
typedef enum {
|
||||
COREDUMP_MEMORY_DRAM,
|
||||
COREDUMP_MEMORY_IRAM,
|
||||
#if SOC_RTC_MEM_SUPPORTED
|
||||
COREDUMP_MEMORY_RTC,
|
||||
COREDUMP_MEMORY_RTC_FAST,
|
||||
#endif
|
||||
COREDUMP_MEMORY_MAX,
|
||||
COREDUMP_MEMORY_START = COREDUMP_MEMORY_DRAM
|
||||
} coredump_region_t;
|
||||
|
@ -28,10 +28,12 @@ extern int _coredump_dram_start;
|
||||
extern int _coredump_dram_end;
|
||||
extern int _coredump_iram_start;
|
||||
extern int _coredump_iram_end;
|
||||
#if SOC_RTC_MEM_SUPPORTED
|
||||
extern int _coredump_rtc_start;
|
||||
extern int _coredump_rtc_end;
|
||||
extern int _coredump_rtc_fast_start;
|
||||
extern int _coredump_rtc_fast_end;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief In the menconfig, it is possible to specify a specific stack size for
|
||||
@ -226,8 +228,10 @@ uint32_t esp_core_dump_get_user_ram_segments(void)
|
||||
|
||||
// count number of memory segments to insert into ELF structure
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_dram_end, &_coredump_dram_start) > 0 ? 1 : 0;
|
||||
#if SOC_RTC_MEM_SUPPORTED
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_rtc_end, &_coredump_rtc_start) > 0 ? 1 : 0;
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_rtc_fast_end, &_coredump_rtc_fast_start) > 0 ? 1 : 0;
|
||||
#endif
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_iram_end, &_coredump_iram_start) > 0 ? 1 : 0;
|
||||
|
||||
return total_sz;
|
||||
@ -238,8 +242,10 @@ uint32_t esp_core_dump_get_user_ram_size(void)
|
||||
uint32_t total_sz = 0;
|
||||
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_dram_end, &_coredump_dram_start);
|
||||
#if SOC_RTC_MEM_SUPPORTED
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_rtc_end, &_coredump_rtc_start);
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_rtc_fast_end, &_coredump_rtc_fast_start);
|
||||
#endif
|
||||
total_sz += COREDUMP_GET_MEMORY_SIZE(&_coredump_iram_end, &_coredump_iram_start);
|
||||
|
||||
return total_sz;
|
||||
@ -262,6 +268,7 @@ int esp_core_dump_get_user_ram_info(coredump_region_t region, uint32_t *start)
|
||||
total_sz = (uint8_t *)&_coredump_iram_end - (uint8_t *)&_coredump_iram_start;
|
||||
break;
|
||||
|
||||
#if SOC_RTC_MEM_SUPPORTED
|
||||
case COREDUMP_MEMORY_RTC:
|
||||
*start = (uint32_t)&_coredump_rtc_start;
|
||||
total_sz = (uint8_t *)&_coredump_rtc_end - (uint8_t *)&_coredump_rtc_start;
|
||||
@ -271,6 +278,7 @@ int esp_core_dump_get_user_ram_info(coredump_region_t region, uint32_t *start)
|
||||
*start = (uint32_t)&_coredump_rtc_fast_start;
|
||||
total_sz = (uint8_t *)&_coredump_rtc_fast_end - (uint8_t *)&_coredump_rtc_fast_start;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user