diff --git a/tools/platformio-build.py b/tools/platformio-build.py
index a462ff391a..56d5e84643 100644
--- a/tools/platformio-build.py
+++ b/tools/platformio-build.py
@@ -59,7 +59,13 @@ def scons_patched_match_splitext(path, suffixes=None):
     gzip_switch = ["--gzip", "PIO"]
 
 env.Append(
-    ASFLAGS=["-x", "assembler-with-cpp"],
+    ASFLAGS=[
+        "-mlongcalls",
+        "-mtext-section-literals",
+    ],
+    ASPPFLAGS=[
+        "-x", "assembler-with-cpp",
+    ],
 
     # General options that are passed to the C compiler (C only; not C++)
     CFLAGS=[
@@ -166,9 +172,6 @@ def scons_patched_match_splitext(path, suffixes=None):
     )
 )
 
-# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
-env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
-
 flatten_cppdefines = env.Flatten(env['CPPDEFINES'])
 
 #