Skip to content

[bsp/stm32] 修复linux下编译的可执行文件无法启动问题 #10169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f072-st-nucleo/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F030x6 || STM32F030x8 || STM32F031x6
# STM32F038xx || STM32F042x6 || STM32F048xx
# STM32F070x6 || STM32F051x8 || STM32F058xx
# STM32F071xB || STM32F072xB || STM32F078xx
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F072xB'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f072-st-nucleo/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ path = [cwd]
path += [os.path.join(cwd, 'CubeMX_Config', 'Inc')]


# STM32F030x6 || STM32F030x8 || STM32F031x6
# STM32F038xx || STM32F042x6 || STM32F048xx
# STM32F070x6 || STM32F051x8 || STM32F058xx
# STM32F071xB || STM32F072xB || STM32F078xx
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
# You can select chips from the list above
CPPDEFINES = ['STM32F072xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)

# if os.path.isfile(os.path.join(cwd, "ports", 'SConscript')):
# group = group + SConscript(os.path.join("ports", 'SConscript'))
Expand Down
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f091-st-nucleo/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F030x6 || STM32F030x8 || STM32F031x6
# STM32F038xx || STM32F042x6 || STM32F048xx
# STM32F070x6 || STM32F051x8 || STM32F058xx
# STM32F071xB || STM32F072xB || STM32F078xx
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
# You can select chips from the list above
env.Append(CPPDEFINES=['STM32F091xC'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f091-st-nucleo/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ path = [cwd]
path += [os.path.join(cwd, 'CubeMX_Config', 'Inc')]


# STM32F030x6 || STM32F030x8 || STM32F031x6
# STM32F038xx || STM32F042x6 || STM32F048xx
# STM32F070x6 || STM32F051x8 || STM32F058xx
# STM32F071xB || STM32F072xB || STM32F078xx
# STM32F070xB || STM32F091xC || STM32F098xx || STM32F030xC
# You can select chips from the list above
CPPDEFINES = ['STM32F091xC']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)

# if os.path.isfile(os.path.join(cwd, "ports", 'SConscript')):
# group = group + SConscript(os.path.join("ports", 'SConscript'))
Expand Down
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f103-100ask-mini/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F103xB'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-100ask-mini/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-100ask-mini/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
CPPDEFINES = ['STM32F103xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f103-100ask-pro/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F103xE'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-100ask-pro/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-100ask-pro/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
CPPDEFINES = ['STM32F103xE']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
3 changes: 3 additions & 0 deletions bsp/stm32/stm32f103-atk-nano/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

env.Append(CPPDEFINES = ['STM32F103xB'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-atk-nano/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
3 changes: 1 addition & 2 deletions bsp/stm32/stm32f103-atk-nano/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']

CPPDEFINES = ['STM32F103xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f103-atk-warshipv3/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F103xE'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-atk-warshipv3/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-atk-warshipv3/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
CPPDEFINES = ['STM32F103xE']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f103-blue-pill/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F103xB'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-blue-pill/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-blue-pill/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
CPPDEFINES = ['STM32F103xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f103-dofly-M3S/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F103xE'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-dofly-M3S/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-dofly-M3S/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
CPPDEFINES = ['STM32F103xE']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
9 changes: 9 additions & 0 deletions bsp/stm32/stm32f103-dofly-lyc8/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
env.Append(CPPDEFINES = ['STM32F103xB'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-dofly-lyc8/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map'])

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
9 changes: 1 addition & 8 deletions bsp/stm32/stm32f103-dofly-lyc8/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,5 @@ elif rtconfig.PLATFORM in ['armcc', 'armclang']:
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']

# STM32F100xB || STM32F100xE || STM32F101x6
# STM32F101xB || STM32F101xE || STM32F101xG
# STM32F102x6 || STM32F102xB || STM32F103x6
# STM32F103xB || STM32F103xE || STM32F103xG
# STM32F105xC || STM32F107xC)
# You can select chips from the list above
CPPDEFINES = ['STM32F103xB']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group')
3 changes: 3 additions & 0 deletions bsp/stm32/stm32f103-fire-arbitrary/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# for module compiling
import os
Import('RTT_ROOT')
Import('env')
from building import *

cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)

env.Append(CPPDEFINES = ['STM32F103xE'])

for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
Expand Down
1 change: 1 addition & 0 deletions bsp/stm32/stm32f103-fire-arbitrary/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if rtconfig.PLATFORM in ['iccarm']:
env.Replace(ARFLAGS = [''])
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

Expand Down
Loading