From 0c3eb04a37ce2cae46b0b2ae2ba058f89166d27d Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 13 Mar 2021 08:01:02 -0300 Subject: [PATCH] No extra build folder for st/jlink upload (#21341) --- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 5c2bde7700..36704af283 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -22,10 +22,9 @@ def add_cpu_freq(): # # It will separe release and debug build folders. # It useful when we need keep two live versions: one debug, for debugging, -# other release, for flashing. +# other release, for flashing (when upload is not done automatically by jlink/stlink). # Without this, PIO will recompile everything twice for any small change. -# -if env.GetBuildType() == "debug": +if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink']: env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug' # On some platform, F_CPU is a runtime variable. Since it's used to convert from ns