diff --git a/platformio.ini b/platformio.ini index e8926d9..0c9a28c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -104,7 +104,7 @@ build_type = release board_build.filesystem = littlefs [env:gravity32-release] -framework = arduino +framework = ${common_env_data.framework} platform = ${common_env_data.platform32} upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} @@ -124,7 +124,6 @@ board = wemos_d1_mini32 build_type = release board_build.partitions = part32.csv board_build.filesystem = littlefs -monitor_filters = esp32_exception_decoder board_build.embed_txtfiles = html/calibration.min.htm html/config.min.htm @@ -135,9 +134,9 @@ board_build.embed_txtfiles = html/test.min.htm [env:gravity32c3-release] -framework = arduino +framework = ${common_env_data.framework} platform = ${common_env_data.platform32} -upload_speed = 115200 +upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} extra_scripts = ${common_env_data.extra_scripts} build_unflags = @@ -157,7 +156,6 @@ board = lolin_c3_mini build_type = release board_build.partitions = part32.csv board_build.filesystem = littlefs -monitor_filters = esp32_exception_decoder board_build.embed_txtfiles = html/calibration.min.htm html/config.min.htm @@ -168,17 +166,14 @@ board_build.embed_txtfiles = html/test.min.htm [env:gravity32c3-debug] -framework = arduino +framework = ${common_env_data.framework} platform = ${common_env_data.platform32} -upload_speed = 115200 +upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} +monitor_filters = time, colorize, log2file, esp32_exception_decoder extra_scripts = ${common_env_data.extra_scripts} -debug_tool = custom -debug_server = - ${platformio.packages_dir}/tool-openocd-esp32/bin/openocd - -f - ${platformio.packages_dir}/tool-openocd-esp32/share/openocd/scripts/board/esp32c3-builtin.cfg -debug_port = localhost:3333 +upload_port = COM8 +debug_tool = esp-prog debug_init_break = break setup build_unflags = -DCFG_DISABLE_LOGGING @@ -195,19 +190,21 @@ build_flags = -Wl,-Map,output.map ${common_env_data.build_flags} -DLOG_LEVEL=6 - -DCORE_DEBUG_LEVEL=0 + -DCORE_DEBUG_LEVEL=5 + -DJTAG_DEBUG -DESP32C3 -DARDUINO_ESP32C3_DEV + #-DARDUINO_USB_MODE=1 + #-DARDUINO_USB_CDC_ON_BOOT=1 -DCOLLECT_PERFDATA # Collect runtime data for a few defined methods to measure time, dumped to serial and/or influxdb lib_deps = ${common_env_data.lib_deps} ${common_env_data.lib_deps32} lib_ignore = -board = lolin_c3_mini +board = esp32-c3-devkitm-1 build_type = debug board_build.partitions = part32.csv board_build.filesystem = littlefs -monitor_filters = esp32_exception_decoder board_build.embed_txtfiles = html/calibration.min.htm html/config.min.htm @@ -218,9 +215,9 @@ board_build.embed_txtfiles = html/test.min.htm ; [env:gravity32s2-release] -; framework = arduino +; framework = ${common_env_data.framework} ; platform = ${common_env_data.platform32} -; upload_speed = 115200 +; upload_speed = ${common_env_data.upload_speed} ; monitor_speed = ${common_env_data.monitor_speed} ; extra_scripts = ${common_env_data.extra_scripts} ; build_unflags = @@ -240,7 +237,6 @@ board_build.embed_txtfiles = ; build_type = debug ; board_build.partitions = part32.csv ; board_build.filesystem = littlefs -; monitor_filters = esp32_exception_decoder ; board_build.embed_txtfiles = ; html/calibration.min.htm ; html/config.min.htm diff --git a/src/main.hpp b/src/main.hpp index 0c2ace0..ccbb43a 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -52,8 +52,14 @@ extern RunMode runMode; #define ESPhttpUpdate httpUpdate #define ESP_RESET ESP.restart #define ESP8266WebServer WebServer +#if defined(JTAG_DEBUG) +#define PIN_SDA 8 +#define PIN_SCL 9 +#warning "ESP32C3 JTAG debugging enabled, using GYRO on GPIO 8/9" +#else #define PIN_SDA 7 #define PIN_SCL 6 +#endif #define PIN_DS A3 #define PIN_A0 A0 // This should be the LED_BUILTIN, but that is also connected SDA (Gyro) so we cannot use both. So we point LED to pin 8 which is not used.