Skip to content

Commit d02c1c7

Browse files
authored
Update IDF, fix SS definition, add custom partitions and debug level selection (#174)
* Add build time partitions compilation * Fix wrong definition of SS pin * Add support for core debug level selection * update idf libs
1 parent ee8149e commit d02c1c7

File tree

185 files changed

+43141
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+43141
-468
lines changed

Diff for: boards.txt

+66
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
menu.UploadSpeed=Upload Speed
22
menu.FlashFreq=Flash Frequency
3+
menu.DebugLevel=Core Debug Level
34

45
##############################################################
6+
57
esp32.name=ESP32 Dev Module
68

79
esp32.upload.tool=esptool
@@ -41,7 +43,62 @@ esp32.menu.UploadSpeed.460800.upload.speed=460800
4143
esp32.menu.UploadSpeed.512000.windows=512000
4244
esp32.menu.UploadSpeed.512000.upload.speed=512000
4345

46+
esp32.menu.DebugLevel.none=None
47+
esp32.menu.DebugLevel.none.build.code_debug=0
48+
esp32.menu.DebugLevel.error=Error
49+
esp32.menu.DebugLevel.error.build.code_debug=1
50+
esp32.menu.DebugLevel.warn=Warn
51+
esp32.menu.DebugLevel.warn.build.code_debug=2
52+
esp32.menu.DebugLevel.info=Info
53+
esp32.menu.DebugLevel.info.build.code_debug=3
54+
esp32.menu.DebugLevel.debug=Debug
55+
esp32.menu.DebugLevel.debug.build.code_debug=4
56+
esp32.menu.DebugLevel.verbose=Verbose
57+
esp32.menu.DebugLevel.verbose.build.code_debug=5
58+
59+
##############################################################
60+
61+
esp32thing.name=SparkFun ESP32 Thing
62+
63+
esp32thing.upload.tool=esptool
64+
esp32thing.upload.maximum_size=1044464
65+
esp32thing.upload.maximum_data_size=294912
66+
esp32thing.upload.wait_for_upload_port=true
67+
68+
esp32thing.serial.disableDTR=true
69+
esp32thing.serial.disableRTS=true
70+
71+
esp32thing.build.mcu=esp32
72+
esp32thing.build.core=esp32
73+
esp32thing.build.variant=esp32thing
74+
esp32thing.build.board=ESP32_THING
75+
76+
esp32thing.build.f_cpu=240000000L
77+
esp32thing.build.flash_mode=dio
78+
esp32thing.build.flash_size=4MB
79+
80+
esp32thing.menu.FlashFreq.80=80MHz
81+
esp32thing.menu.FlashFreq.80.build.flash_freq=80m
82+
esp32thing.menu.FlashFreq.40=40MHz
83+
esp32thing.menu.FlashFreq.40.build.flash_freq=40m
84+
85+
esp32thing.menu.UploadSpeed.921600=921600
86+
esp32thing.menu.UploadSpeed.921600.upload.speed=921600
87+
esp32thing.menu.UploadSpeed.115200=115200
88+
esp32thing.menu.UploadSpeed.115200.upload.speed=115200
89+
esp32thing.menu.UploadSpeed.256000.windows=256000
90+
esp32thing.menu.UploadSpeed.256000.upload.speed=256000
91+
esp32thing.menu.UploadSpeed.230400.windows.upload.speed=256000
92+
esp32thing.menu.UploadSpeed.230400=230400
93+
esp32thing.menu.UploadSpeed.230400.upload.speed=230400
94+
esp32thing.menu.UploadSpeed.460800.linux=460800
95+
esp32thing.menu.UploadSpeed.460800.macosx=460800
96+
esp32thing.menu.UploadSpeed.460800.upload.speed=460800
97+
esp32thing.menu.UploadSpeed.512000.windows=512000
98+
esp32thing.menu.UploadSpeed.512000.upload.speed=512000
99+
44100
##############################################################
101+
45102
esp320.name=Electronic SweetPeas - ESP320
46103

47104
esp320.upload.tool=esptool
@@ -82,6 +139,7 @@ esp320.menu.UploadSpeed.512000.windows=512000
82139
esp320.menu.UploadSpeed.512000.upload.speed=512000
83140

84141
##############################################################
142+
85143
nano32.name=Nano32
86144

87145
nano32.upload.tool=esptool
@@ -122,6 +180,7 @@ nano32.menu.UploadSpeed.512000.windows=512000
122180
nano32.menu.UploadSpeed.512000.upload.speed=512000
123181

124182
##############################################################
183+
125184
lolin32.name=WEMOS LoLin32
126185

127186
lolin32.upload.tool=esptool
@@ -162,6 +221,7 @@ lolin32.menu.UploadSpeed.512000.windows=512000
162221
lolin32.menu.UploadSpeed.512000.upload.speed=512000
163222

164223
##############################################################
224+
165225
espea32.name=ESPea32
166226

167227
espea32.upload.tool=esptool
@@ -202,6 +262,7 @@ espea32.menu.UploadSpeed.512000.windows=512000
202262
espea32.menu.UploadSpeed.512000.upload.speed=512000
203263

204264
##############################################################
265+
205266
quantum.name=Noduino Quantum
206267

207268
quantum.upload.tool=esptool
@@ -242,6 +303,7 @@ quantum.menu.UploadSpeed.512000.windows=512000
242303
quantum.menu.UploadSpeed.512000.upload.speed=512000
243304

244305
##############################################################
306+
245307
node32s.name=Node32s
246308

247309
node32s.upload.tool=esptool
@@ -280,7 +342,9 @@ node32s.menu.UploadSpeed.460800.macosx=460800
280342
node32s.menu.UploadSpeed.460800.upload.speed=460800
281343
node32s.menu.UploadSpeed.512000.windows=512000
282344
node32s.menu.UploadSpeed.512000.upload.speed=512000
345+
283346
##############################################################
347+
284348
hornbill32dev.name=Hornbill ESP32 Dev
285349

286350
hornbill32dev.upload.tool=esptool
@@ -318,7 +382,9 @@ hornbill32dev.menu.UploadSpeed.460800.macosx=460800
318382
hornbill32dev.menu.UploadSpeed.460800.upload.speed=460800
319383
hornbill32dev.menu.UploadSpeed.512000.windows=512000
320384
hornbill32dev.menu.UploadSpeed.512000.upload.speed=512000
385+
321386
##############################################################
387+
322388
hornbill32minima.name=Hornbill ESP32 Minima
323389

324390
hornbill32minima.upload.tool=esptool

Diff for: cores/esp32/esp32-hal-log.h

+11-5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ extern "C"
3232
#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL ARDUHAL_LOG_LEVEL_NONE
3333
#endif
3434

35+
#ifndef CORE_DEBUG_LEVEL
36+
#define ARDUHAL_LOG_LEVEL CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL
37+
#else
38+
#define ARDUHAL_LOG_LEVEL CORE_DEBUG_LEVEL
39+
#endif
40+
3541
#ifndef CONFIG_ARDUHAL_LOG_COLORS
3642
#define CONFIG_ARDUHAL_LOG_COLORS 0
3743
#endif
@@ -71,31 +77,31 @@ int log_printf(const char *fmt, ...);
7177
#define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter format ARDUHAL_LOG_RESET_COLOR "\r\n"
7278
#define ARDUHAL_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter "[" #letter "][%s:%u] %s(): " format ARDUHAL_LOG_RESET_COLOR "\r\n", pathToFileName(__FILE__), __LINE__, __FUNCTION__
7379

74-
#if CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
80+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
7581
#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__)
7682
#else
7783
#define log_v(format, ...)
7884
#endif
7985

80-
#if CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
86+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
8187
#define log_d(format, ...) log_printf(ARDUHAL_LOG_FORMAT(D, format), ##__VA_ARGS__)
8288
#else
8389
#define log_d(format, ...)
8490
#endif
8591

86-
#if CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
92+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
8793
#define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
8894
#else
8995
#define log_i(format, ...)
9096
#endif
9197

92-
#if CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL >= ARDUHAL_LOG_LEVEL_WARN
98+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN
9399
#define log_w(format, ...) log_printf(ARDUHAL_LOG_FORMAT(W, format), ##__VA_ARGS__)
94100
#else
95101
#define log_w(format, ...)
96102
#endif
97103

98-
#if CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
104+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
99105
#define log_e(format, ...) log_printf(ARDUHAL_LOG_FORMAT(E, format), ##__VA_ARGS__)
100106
#else
101107
#define log_e(format, ...)

Diff for: libraries/WiFi/src/WiFiGeneric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void WiFiGenericClass::removeEvent(WiFiEventCb cbEvent, system_event_id_t event)
166166
* callback for WiFi events
167167
* @param arg
168168
*/
169-
#if CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
169+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
170170
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_PROBEREQRECVED", "AP_STA_GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
171171
const char * system_event_reasons[] = { "UNSPECIFIED", "AUTH_EXPIRE", "AUTH_LEAVE", "ASSOC_EXPIRE", "ASSOC_TOOMANY", "NOT_AUTHED", "NOT_ASSOCED", "ASSOC_LEAVE", "ASSOC_NOT_AUTHED", "DISASSOC_PWRCAP_BAD", "DISASSOC_SUPCHAN_BAD", "IE_INVALID", "MIC_FAILURE", "4WAY_HANDSHAKE_TIMEOUT", "GROUP_KEY_UPDATE_TIMEOUT", "IE_IN_4WAY_DIFFERS", "GROUP_CIPHER_INVALID", "PAIRWISE_CIPHER_INVALID", "AKMP_INVALID", "UNSUPP_RSN_IE_VERSION", "INVALID_RSN_IE_CAP", "802_1X_AUTH_FAILED", "CIPHER_SUITE_REJECTED", "BEACON_TIMEOUT", "NO_AP_FOUND", "AUTH_FAIL", "ASSOC_FAIL", "HANDSHAKE_TIMEOUT" };
172172
#define reason2str(r) ((r>174)?system_event_reasons[r-174]:system_event_reasons[r-1])

Diff for: platform.txt

+9-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp
66
tools.esptool.cmd="{runtime.platform.path}/tools/esptool"
77
tools.esptool.cmd.windows="{runtime.platform.path}/tools/esptool.exe"
88

9+
tools.gen_esp32part.cmd=python "{runtime.platform.path}/tools/gen_esp32part.py"
10+
tools.gen_esp32part.cmd.windows="{runtime.platform.path}/tools/gen_esp32part.exe"
11+
912
compiler.warning_flags=-w
1013
compiler.warning_flags.none=-w
1114
compiler.warning_flags.default=
@@ -14,7 +17,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra
1417

1518
compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/
1619
compiler.sdk.path={runtime.platform.path}/tools/sdk
17-
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
20+
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bluedroid" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mbedtls_port" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
1821

1922
compiler.c.cmd=xtensa-esp32-elf-gcc
2023
compiler.c.flags=-std=gnu99 -Os -g3 -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
@@ -27,7 +30,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
2730

2831
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
2932
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority
30-
compiler.c.elf.libs=-lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoap -lcoexist -lcore -lcxx -ldriver -lesp32 -lethernet -lexpat -lfatfs -lfreertos -lhal -ljson -llog -llwip -lm -lmbedtls -lmdns -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lrtc -lsdmmc -lsmartconfig -lspi_flash -ltcpip_adapter -lulp -lvfs -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module -lgcc -lstdc++
33+
compiler.c.elf.libs=-lgcc -lstdc++ -lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoap -lcoexist -lcore -lcxx -ldriver -lesp32 -lethernet -lexpat -lfatfs -lfreertos -lhal -ljson -llog -llwip -lm -lmbedtls -lmdns -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lrtc -lsdmmc -lsmartconfig -lspi_flash -ltcpip_adapter -lulp -lvfs -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module
3134

3235
compiler.as.cmd=xtensa-esp32-elf-as
3336

@@ -37,7 +40,8 @@ compiler.ar.flags=cru
3740
compiler.size.cmd=xtensa-esp32-elf-size
3841

3942
# This can be overriden in boards.txt
40-
build.extra_flags=-DESP32
43+
build.code_debug=0
44+
build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug}
4145

4246
# These can be overridden in platform.local.txt
4347
compiler.c.extra_flags=
@@ -64,7 +68,7 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
6468
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"
6569

6670
## Create eeprom
67-
recipe.objcopy.eep.pattern=
71+
recipe.objcopy.eep.pattern={tools.gen_esp32part.cmd} -q "{runtime.platform.path}/tools/partitions/default.csv" "{build.path}/{build.project_name}.partitions.bin"
6872

6973
## Create hex
7074
recipe.objcopy.hex.pattern={tools.esptool.cmd} --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
@@ -83,4 +87,4 @@ recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss)\s+([0-9]+).*
8387
tools.esptool.upload.protocol=esp32
8488
tools.esptool.upload.params.verbose=
8589
tools.esptool.upload.params.quiet=
86-
tools.esptool.upload.pattern={cmd} --chip esp32 --port "{serial.port}" --baud {upload.speed} write_flash -z --flash_freq {build.flash_freq} --flash_mode {build.flash_mode} --flash_size {build.flash_size} 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader.bin" 0x8000 "{runtime.platform.path}/tools/sdk/bin/partitions_singleapp.bin" 0x10000 "{build.path}/{build.project_name}.bin"
90+
tools.esptool.upload.pattern={cmd} --chip esp32 --port "{serial.port}" --baud {upload.speed} --before default_reset --after hard_reset write_flash -z --flash_freq {build.flash_freq} --flash_mode {build.flash_mode} --flash_size {build.flash_size} 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0x10000 "{build.path}/{build.project_name}.bin"

0 commit comments

Comments
 (0)