Skip to content

Commit f422b6a

Browse files
authored
[bsp/stm32] 修复linux下编译的可执行文件无法启动问题 (#10169)
1 parent e131a00 commit f422b6a

File tree

246 files changed

+591
-354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+591
-354
lines changed

bsp/stm32/stm32f072-st-nucleo/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F030x6 || STM32F030x8 || STM32F031x6
12+
# STM32F038xx || STM32F042x6 || STM32F048xx
13+
# STM32F070x6 || STM32F051x8 || STM32F058xx
14+
# STM32F071xB || STM32F072xB || STM32F078xx
15+
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F072xB'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f072-st-nucleo/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ path = [cwd]
1313
path += [os.path.join(cwd, 'CubeMX_Config', 'Inc')]
1414

1515

16-
# STM32F030x6 || STM32F030x8 || STM32F031x6
17-
# STM32F038xx || STM32F042x6 || STM32F048xx
18-
# STM32F070x6 || STM32F051x8 || STM32F058xx
19-
# STM32F071xB || STM32F072xB || STM32F078xx
20-
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
21-
# You can select chips from the list above
22-
CPPDEFINES = ['STM32F072xB']
23-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
16+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
2417

2518
# if os.path.isfile(os.path.join(cwd, "ports", 'SConscript')):
2619
# group = group + SConscript(os.path.join("ports", 'SConscript'))

bsp/stm32/stm32f091-st-nucleo/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F030x6 || STM32F030x8 || STM32F031x6
12+
# STM32F038xx || STM32F042x6 || STM32F048xx
13+
# STM32F070x6 || STM32F051x8 || STM32F058xx
14+
# STM32F071xB || STM32F072xB || STM32F078xx
15+
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES=['STM32F091xC'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f091-st-nucleo/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ path = [cwd]
1313
path += [os.path.join(cwd, 'CubeMX_Config', 'Inc')]
1414

1515

16-
# STM32F030x6 || STM32F030x8 || STM32F031x6
17-
# STM32F038xx || STM32F042x6 || STM32F048xx
18-
# STM32F070x6 || STM32F051x8 || STM32F058xx
19-
# STM32F071xB || STM32F072xB || STM32F078xx
20-
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
21-
# You can select chips from the list above
22-
CPPDEFINES = ['STM32F091xC']
23-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
16+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
2417

2518
# if os.path.isfile(os.path.join(cwd, "ports", 'SConscript')):
2619
# group = group + SConscript(os.path.join("ports", 'SConscript'))

bsp/stm32/stm32f103-100ask-mini/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F100xB || STM32F100xE || STM32F101x6
12+
# STM32F101xB || STM32F101xE || STM32F101xG
13+
# STM32F102x6 || STM32F102xB || STM32F103x6
14+
# STM32F103xB || STM32F103xE || STM32F103xG
15+
# STM32F105xC || STM32F107xC)
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F103xB'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-100ask-mini/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-100ask-mini/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
2828
elif rtconfig.PLATFORM in ['iccarm']:
2929
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
3030

31-
# STM32F100xB || STM32F100xE || STM32F101x6
32-
# STM32F101xB || STM32F101xE || STM32F101xG
33-
# STM32F102x6 || STM32F102xB || STM32F103x6
34-
# STM32F103xB || STM32F103xE || STM32F103xG
35-
# STM32F105xC || STM32F107xC)
36-
# You can select chips from the list above
37-
CPPDEFINES = ['STM32F103xB']
38-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
31+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
3932
Return('group')

bsp/stm32/stm32f103-100ask-pro/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F100xB || STM32F100xE || STM32F101x6
12+
# STM32F101xB || STM32F101xE || STM32F101xG
13+
# STM32F102x6 || STM32F102xB || STM32F103x6
14+
# STM32F103xB || STM32F103xE || STM32F103xG
15+
# STM32F105xC || STM32F107xC)
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F103xE'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-100ask-pro/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-100ask-pro/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
3131
elif rtconfig.PLATFORM in ['iccarm']:
3232
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
3333

34-
# STM32F100xB || STM32F100xE || STM32F101x6
35-
# STM32F101xB || STM32F101xE || STM32F101xG
36-
# STM32F102x6 || STM32F102xB || STM32F103x6
37-
# STM32F103xB || STM32F103xE || STM32F103xG
38-
# STM32F105xC || STM32F107xC)
39-
# You can select chips from the list above
40-
CPPDEFINES = ['STM32F103xE']
41-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
34+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
4235
Return('group')

bsp/stm32/stm32f103-atk-nano/SConscript

+3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
env.Append(CPPDEFINES = ['STM32F103xB'])
12+
1013
for d in list:
1114
path = os.path.join(cwd, d)
1215
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-atk-nano/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-atk-nano/board/SConscript

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
2828
elif rtconfig.PLATFORM in ['iccarm']:
2929
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
3030

31-
CPPDEFINES = ['STM32F103xB']
32-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
31+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
3332
Return('group')

bsp/stm32/stm32f103-atk-warshipv3/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F100xB || STM32F100xE || STM32F101x6
12+
# STM32F101xB || STM32F101xE || STM32F101xG
13+
# STM32F102x6 || STM32F102xB || STM32F103x6
14+
# STM32F103xB || STM32F103xE || STM32F103xG
15+
# STM32F105xC || STM32F107xC)
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F103xE'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-atk-warshipv3/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-atk-warshipv3/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
3131
elif rtconfig.PLATFORM in ['iccarm']:
3232
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
3333

34-
# STM32F100xB || STM32F100xE || STM32F101x6
35-
# STM32F101xB || STM32F101xE || STM32F101xG
36-
# STM32F102x6 || STM32F102xB || STM32F103x6
37-
# STM32F103xB || STM32F103xE || STM32F103xG
38-
# STM32F105xC || STM32F107xC)
39-
# You can select chips from the list above
40-
CPPDEFINES = ['STM32F103xE']
41-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
34+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
4235
Return('group')

bsp/stm32/stm32f103-blue-pill/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F100xB || STM32F100xE || STM32F101x6
12+
# STM32F101xB || STM32F101xE || STM32F101xG
13+
# STM32F102x6 || STM32F102xB || STM32F103x6
14+
# STM32F103xB || STM32F103xE || STM32F103xG
15+
# STM32F105xC || STM32F107xC)
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F103xB'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-blue-pill/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-blue-pill/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
2424
elif rtconfig.PLATFORM in ['iccarm']:
2525
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
2626

27-
# STM32F100xB || STM32F100xE || STM32F101x6
28-
# STM32F101xB || STM32F101xE || STM32F101xG
29-
# STM32F102x6 || STM32F102xB || STM32F103x6
30-
# STM32F103xB || STM32F103xE || STM32F103xG
31-
# STM32F105xC || STM32F107xC)
32-
# You can select chips from the list above
33-
CPPDEFINES = ['STM32F103xB']
34-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
27+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
3528
Return('group')

bsp/stm32/stm32f103-dofly-M3S/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F100xB || STM32F100xE || STM32F101x6
12+
# STM32F101xB || STM32F101xE || STM32F101xG
13+
# STM32F102x6 || STM32F102xB || STM32F103x6
14+
# STM32F103xB || STM32F103xE || STM32F103xG
15+
# STM32F105xC || STM32F107xC)
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F103xE'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-dofly-M3S/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-dofly-M3S/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
3434
elif rtconfig.PLATFORM in ['iccarm']:
3535
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
3636

37-
# STM32F100xB || STM32F100xE || STM32F101x6
38-
# STM32F101xB || STM32F101xE || STM32F101xG
39-
# STM32F102x6 || STM32F102xB || STM32F103x6
40-
# STM32F103xB || STM32F103xE || STM32F103xG
41-
# STM32F105xC || STM32F107xC)
42-
# You can select chips from the list above
43-
CPPDEFINES = ['STM32F103xE']
44-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
37+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
4538
Return('group')

bsp/stm32/stm32f103-dofly-lyc8/SConscript

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
# STM32F100xB || STM32F100xE || STM32F101x6
12+
# STM32F101xB || STM32F101xE || STM32F101xG
13+
# STM32F102x6 || STM32F102xB || STM32F103x6
14+
# STM32F103xB || STM32F103xE || STM32F103xG
15+
# STM32F105xC || STM32F107xC)
16+
# You can select chips from the list above
17+
env.Append(CPPDEFINES = ['STM32F103xB'])
18+
1019
for d in list:
1120
path = os.path.join(cwd, d)
1221
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-dofly-lyc8/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map'])
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

bsp/stm32/stm32f103-dofly-lyc8/board/SConscript

+1-8
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
2424
elif rtconfig.PLATFORM in ['iccarm']:
2525
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
2626

27-
# STM32F100xB || STM32F100xE || STM32F101x6
28-
# STM32F101xB || STM32F101xE || STM32F101xG
29-
# STM32F102x6 || STM32F102xB || STM32F103x6
30-
# STM32F103xB || STM32F103xE || STM32F103xG
31-
# STM32F105xC || STM32F107xC)
32-
# You can select chips from the list above
33-
CPPDEFINES = ['STM32F103xB']
34-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
27+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
3528
Return('group')

bsp/stm32/stm32f103-fire-arbitrary/SConscript

+3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# for module compiling
22
import os
33
Import('RTT_ROOT')
4+
Import('env')
45
from building import *
56

67
cwd = GetCurrentDir()
78
objs = []
89
list = os.listdir(cwd)
910

11+
env.Append(CPPDEFINES = ['STM32F103xE'])
12+
1013
for d in list:
1114
path = os.path.join(cwd, d)
1215
if os.path.isfile(os.path.join(path, 'SConscript')):

bsp/stm32/stm32f103-fire-arbitrary/SConstruct

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3131
env.Replace(ARFLAGS = [''])
3232
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3333

34+
Export('env')
3435
Export('RTT_ROOT')
3536
Export('rtconfig')
3637

0 commit comments

Comments
 (0)