Skip to content

Commit 0672e7e

Browse files
committed
fix for pio core 4.1
1 parent 076ab60 commit 0672e7e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

buildroot/share/PlatformIO/scripts/mks_robin_nano.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import os
12
Import("env")
23

34
# Relocate firmware from 0x08000000 to 0x08007000
45
for define in env['CPPDEFINES']:
56
if define[0] == "VECT_TAB_ADDR":
67
env['CPPDEFINES'].remove(define)
78
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000"))
8-
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld")
9+
10+
custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld")
11+
for i, flag in enumerate(env["LINKFLAGS"]):
12+
if "-Wl,-T" in flag:
13+
env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
14+
elif flag == "-T":
15+
env["LINKFLAGS"][i + 1] = custom_ld_script
916

1017
# Encrypt ${PROGNAME}.bin and save it as 'Robin_nano.bin'
1118
def encrypt(source, target, env):

0 commit comments

Comments
 (0)