File tree Expand file tree Collapse file tree 2 files changed +23
-12
lines changed
common-hal/microcontroller Expand file tree Collapse file tree 2 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -120,19 +120,25 @@ CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5
120
120
121
121
# Debugging/Optimization
122
122
ifeq ($(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
127
133
else
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
136
142
endif
137
143
138
144
# 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 =
62
62
GPIO_SEL_18 | // USB D-
63
63
GPIO_SEL_19 | // USB D+
64
64
#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
65
70
#endif // ESP32C3
66
71
67
72
#if defined(CONFIG_IDF_TARGET_ESP32S2 ) || defined (CONFIG_IDF_TARGET_ESP32S3 )
You can’t perform that action at this time.
0 commit comments