File tree Expand file tree Collapse file tree
common-hal/microcontroller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,19 +120,25 @@ CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5
120120
121121# Debugging/Optimization
122122ifeq ($(DEBUG ) , 1)
123- CFLAGS += -DDEBUG -ggdb
124- OPTIMIZATION_FLAGS ?= -Og
125- # You may want to enable these flags to make setting breakpoints easier.
126- # CFLAGS += -fno-inline -fno-ipa-sra
123+ CFLAGS += -ggdb
124+ ifeq ($(IDF_TARGET_ARCH),riscv)
125+ OPTIMIZATION_FLAGS ?= -Os
126+ CFLAGS += -DNDEBUG
127+ else
128+ OPTIMIZATION_FLAGS ?= -Og
129+ CFLAGS += -DDEBUG
130+ endif
131+ # You may want to enable these flags to make setting breakpoints easier.
132+ # CFLAGS += -fno-inline -fno-ipa-sra
127133else
128- CFLAGS += -DNDEBUG -ggdb3
129- # RISC-V is larger than xtensa
130- # Use -Os for RISC-V when it overflows
131- ifeq ($(IDF_TARGET_ARCH),riscv)
132- OPTIMIZATION_FLAGS ?= -Os
133- else
134- OPTIMIZATION_FLAGS ?= -O2
135- endif
134+ CFLAGS += -DNDEBUG -ggdb3
135+ # RISC-V is larger than xtensa
136+ # Use -Os for RISC-V when it overflows
137+ ifeq ($(IDF_TARGET_ARCH),riscv)
138+ OPTIMIZATION_FLAGS ?= -Os
139+ else
140+ OPTIMIZATION_FLAGS ?= -O2
141+ endif
136142endif
137143
138144# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ static const uint64_t pin_mask_reset_forbidden =
6262 GPIO_SEL_18 | // USB D-
6363 GPIO_SEL_19 | // USB D+
6464 #endif
65+ #if defined(CONFIG_ESP_CONSOLE_UART_DEFAULT ) && CONFIG_ESP_CONSOLE_UART_DEFAULT && CONFIG_ESP_CONSOLE_UART_NUM == 0
66+ // Never reset debug UART/console pins.
67+ GPIO_SEL_20 |
68+ GPIO_SEL_21 |
69+ #endif
6570 #endif // ESP32C3
6671
6772 #if defined(CONFIG_IDF_TARGET_ESP32S2 ) || defined (CONFIG_IDF_TARGET_ESP32S3 )
You can’t perform that action at this time.
0 commit comments