mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 13:44:32 +02:00
gdbstub: C3 - protection for UART register region
* reading the UART peripheral registers disturbs gdbstub because it communicates via UART. Hence, we protect it. Closes IDF-2533
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#define GDBSTUB_MEM_REGION_COUNT 9
|
#define GDBSTUB_MEM_REGION_COUNT 9
|
||||||
|
|
||||||
|
#define UART_REG_FIELD_LEN 0x84
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
intptr_t lower;
|
intptr_t lower;
|
||||||
intptr_t upper;
|
intptr_t upper;
|
||||||
@@ -36,8 +38,10 @@ static const mem_bound_t mem_region_table [GDBSTUB_MEM_REGION_COUNT] =
|
|||||||
{SOC_IROM_MASK_LOW, SOC_IROM_MASK_HIGH},
|
{SOC_IROM_MASK_LOW, SOC_IROM_MASK_HIGH},
|
||||||
{SOC_DROM_MASK_LOW, SOC_DROM_MASK_HIGH},
|
{SOC_DROM_MASK_LOW, SOC_DROM_MASK_HIGH},
|
||||||
{SOC_RTC_IRAM_LOW, SOC_RTC_IRAM_HIGH},
|
{SOC_RTC_IRAM_LOW, SOC_RTC_IRAM_HIGH},
|
||||||
// RTC DRAM and RTC DATA are identical with RTC IRAM
|
// RTC DRAM and RTC DATA are identical with RTC IRAM, hence we skip them
|
||||||
{SOC_PERIPHERAL_LOW, SOC_PERIPHERAL_HIGH},
|
// We shouldn't read the uart registers since it will disturb the debugging via UART,
|
||||||
|
// so skip UART part of the peripheral registers.
|
||||||
|
{DR_REG_UART_BASE + UART_REG_FIELD_LEN, SOC_PERIPHERAL_HIGH},
|
||||||
{SOC_DEBUG_LOW, SOC_DEBUG_HIGH},
|
{SOC_DEBUG_LOW, SOC_DEBUG_HIGH},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -48,6 +52,7 @@ static inline bool check_inside_valid_region(intptr_t addr)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user