diff --git a/bsp/stm32/stm32f103-dofly-M3S/.cproject b/bsp/stm32/stm32f103-dofly-M3S/.cproject
index eaeea747e7..ebcf2b2323 100644
--- a/bsp/stm32/stm32f103-dofly-M3S/.cproject
+++ b/bsp/stm32/stm32f103-dofly-M3S/.cproject
@@ -60,22 +60,22 @@
diff --git a/bsp/stm32/stm32f103-yf-ufun/.cproject b/bsp/stm32/stm32f103-yf-ufun/.cproject
index 6501085647..1c88b85c64 100644
--- a/bsp/stm32/stm32f103-yf-ufun/.cproject
+++ b/bsp/stm32/stm32f103-yf-ufun/.cproject
@@ -60,22 +60,21 @@
diff --git a/bsp/stm32/stm32f401-st-nucleo/.cproject b/bsp/stm32/stm32f401-st-nucleo/.cproject
index 6fffea387c..4651155e21 100644
--- a/bsp/stm32/stm32f401-st-nucleo/.cproject
+++ b/bsp/stm32/stm32f401-st-nucleo/.cproject
@@ -62,21 +62,21 @@
diff --git a/bsp/stm32/stm32f407-atk-explorer/.cproject b/bsp/stm32/stm32f407-atk-explorer/.cproject
index f162e4d0b6..a64ff851f1 100644
--- a/bsp/stm32/stm32f407-atk-explorer/.cproject
+++ b/bsp/stm32/stm32f407-atk-explorer/.cproject
@@ -62,22 +62,22 @@
diff --git a/bsp/stm32/stm32f411-st-nucleo/.cproject b/bsp/stm32/stm32f411-st-nucleo/.cproject
index 61e218e54c..2078a87054 100644
--- a/bsp/stm32/stm32f411-st-nucleo/.cproject
+++ b/bsp/stm32/stm32f411-st-nucleo/.cproject
@@ -62,22 +62,21 @@
diff --git a/bsp/stm32/stm32f429-atk-apollo/.cproject b/bsp/stm32/stm32f429-atk-apollo/.cproject
index f91e6f6782..4bd13e765a 100644
--- a/bsp/stm32/stm32f429-atk-apollo/.cproject
+++ b/bsp/stm32/stm32f429-atk-apollo/.cproject
@@ -62,22 +62,22 @@
diff --git a/bsp/stm32/stm32f429-fire-challenger/.cproject b/bsp/stm32/stm32f429-fire-challenger/.cproject
index 0139f0c6aa..4fe60457b7 100644
--- a/bsp/stm32/stm32f429-fire-challenger/.cproject
+++ b/bsp/stm32/stm32f429-fire-challenger/.cproject
@@ -62,22 +62,22 @@
diff --git a/bsp/stm32/stm32f767-atk-apollo/.cproject b/bsp/stm32/stm32f767-atk-apollo/.cproject
index ffe0b49011..d1c84d2651 100644
--- a/bsp/stm32/stm32f767-atk-apollo/.cproject
+++ b/bsp/stm32/stm32f767-atk-apollo/.cproject
@@ -62,22 +62,22 @@
diff --git a/bsp/stm32/stm32l475-atk-pandora/.cproject b/bsp/stm32/stm32l475-atk-pandora/.cproject
index ad720c7dbe..f9f3507d68 100644
--- a/bsp/stm32/stm32l475-atk-pandora/.cproject
+++ b/bsp/stm32/stm32l475-atk-pandora/.cproject
@@ -50,35 +50,35 @@
-
-
-
+
-
-
@@ -95,8 +95,8 @@
-
diff --git a/tools/eclipse.py b/tools/eclipse.py
index 840ed9f191..c7fefc0bda 100644
--- a/tools/eclipse.py
+++ b/tools/eclipse.py
@@ -122,17 +122,25 @@ def ExcludePaths(rootpath, paths):
return ret
-def ConverToEclipsePathFormat(path):
- if path.startswith('.'):
- path = path[1:]
- return '"${workspace_loc:/${ProjName}/' + path + '}"'
+rtt_path_prefix = '"${workspace_loc://${ProjName}//'
+
+
+def ConverToRttEclipsePathFormat(path):
+ return rtt_path_prefix + path + '}"'
+
+
+def IsRttEclipsePathFormat(path):
+ if path.startswith(rtt_path_prefix):
+ return True
+ else :
+ return False
def HandleToolOption(tools, env, project, reset):
BSP_ROOT = os.path.abspath(env['BSP_ROOT'])
CPPDEFINES = project['CPPDEFINES']
- paths = [ConverToEclipsePathFormat(RelativeProjectPath(env, os.path.normpath(i)).replace('\\', '/')) for i in project['CPPPATH']]
+ paths = [ConverToRttEclipsePathFormat(RelativeProjectPath(env, os.path.normpath(i)).replace('\\', '/')) for i in project['CPPPATH']]
for tool in tools:
if tool.get('id').find('c.compile') != 1:
@@ -153,22 +161,13 @@ def HandleToolOption(tools, env, project, reset):
option = include_paths_option
# find all of paths in this project
include_paths = option.findall('listOptionValue')
- project_paths = []
for item in include_paths:
- if reset is True:
- # clean all old configuration
+ if reset is True or IsRttEclipsePathFormat(item.get('value')) :
+ # clean old configuration
option.remove(item)
- else:
- project_paths += [item.get('value')]
-
- if len(project_paths) > 0:
- cproject_paths = set(paths) - set(project_paths)
- else:
- cproject_paths = paths
-
# print('c.compiler.include.paths')
- cproject_paths = sorted(cproject_paths)
- for item in cproject_paths:
+ paths = sorted(paths)
+ for item in paths:
SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': item})
# change the inclue files (default) or definitions
if include_files_option is not None:
@@ -178,7 +177,7 @@ def HandleToolOption(tools, env, project, reset):
#define RTCONFIG_PREINC_H__
/* Automatically generated file; DO NOT EDIT. */
-/* RT-Thread Configuration */
+/* RT-Thread pre-include file */
'''
file_tail = '\n#endif /*RTCONFIG_PREINC_H__*/\n'
@@ -227,7 +226,7 @@ def HandleToolOption(tools, env, project, reset):
items = env['LINKFLAGS'].split(' ')
if '-T' in items:
linker_script = items[items.index('-T') + 1]
- linker_script = ConverToEclipsePathFormat(linker_script)
+ linker_script = ConverToRttEclipsePathFormat(linker_script)
listOptionValue = option.find('listOptionValue')
if listOptionValue != None:
@@ -239,7 +238,7 @@ def HandleToolOption(tools, env, project, reset):
if option.get('id').find('c.linker.option.script') != -1:
items = env['LINKFLAGS'].split(' ')
if '-T' in items:
- linker_script = ConverToEclipsePathFormat(items[items.index('-T') + 1]).strip('"')
+ linker_script = ConverToRttEclipsePathFormat(items[items.index('-T') + 1]).strip('"')
option.set('value',linker_script)
# update nostartfiles config