Skip to content
Open
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
3 changes: 2 additions & 1 deletion .github/workflows/bsp_buildings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ jobs:
RTT_BSP: ${{ matrix.legs.RTT_BSP }}
RTT_TOOL_CHAIN: ${{ matrix.legs.RTT_TOOL_CHAIN }}
SRTT_BSP: ${{ join(matrix.legs.SUB_RTT_BSP, ',') }}
RTT_CI_BUILD_DIST: "1"
run: |
source ~/.env/env.sh
python tools/ci/bsp_buildings.py
Expand Down Expand Up @@ -306,4 +307,4 @@ jobs:
# pr_number: ${{ github.event.pull_request.number }}
# permissions:
# pull-requests: write
# issues: write
# issues: write
6 changes: 6 additions & 0 deletions bsp/ESP/ESP32_C3/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@
CXXFLAGS = CFLAGS

POST_ACTION = OBJCPY + ' -Oihex $TARGET rtthread.hex\n' + SIZE + ' $TARGET \n'

def dist_handle(BSP_ROOT, dist_dir):
import sys
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)
7 changes: 5 additions & 2 deletions bsp/ESP/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
import rtconfig

library_dir = os.path.join(dist_dir, 'libraries')
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')

print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'drivers'), os.path.join(library_dir, 'drivers'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
kconfig = os.path.join(library_path, 'Kconfig')
if os.path.exists(kconfig):
shutil.copyfile(kconfig, os.path.join(library_dir, 'Kconfig'))
10 changes: 8 additions & 2 deletions bsp/Infineon/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ def dist_do_building(BSP_ROOT, dist_dir):

print("=> copy ifx bsp library")
library_dir = os.path.join(dist_dir, 'libraries')
sibling_library_dir = os.path.join(os.path.dirname(dist_dir), 'libraries')
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
if rtconfig.BSP_LIBRARY_TYPE is not None:
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))

print("=> copy sibling bsp drivers")
bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'), os.path.join(sibling_library_dir, 'HAL_Drivers'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(sibling_library_dir, 'Kconfig'))
6 changes: 6 additions & 0 deletions bsp/allwinner/d1s/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@

DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtthread.asm\n'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + './mksdimg.sh\n'

def dist_handle(BSP_ROOT, dist_dir):
import sys
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)
26 changes: 26 additions & 0 deletions bsp/allwinner/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))


def update_kconfig_library_path(dist_dir):
library_dir = os.path.join(dist_dir, 'libraries')
if not os.path.isdir(library_dir):
return

for root, dirs, files in os.walk(library_dir):
if 'Kconfig' not in files:
continue

kconfig_path = os.path.join(root, 'Kconfig')
with open(kconfig_path, 'r') as f:
data = f.read()

data = data.replace('$(BSP_DIR)/../libraries', 'libraries')
data = data.replace('$BSP_DIR/../libraries', 'libraries')
data = data.replace('../libraries', 'libraries')

with open(kconfig_path, 'w') as f:
f.write(data)


# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
Expand All @@ -19,4 +40,9 @@ def dist_do_building(BSP_ROOT, dist_dir):

print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'drivers'), os.path.join(library_dir, 'drivers'))

print("=> copy bsp libos")
bsp_copy_files(os.path.join(library_path, 'libos'), os.path.join(library_dir, 'libos'))

shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
update_kconfig_library_path(dist_dir)
1 change: 1 addition & 0 deletions bsp/at32/at32f421-start/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ menu "On-chip Peripheral Drivers"
depends on RT_USING_SERIAL_V2 && BSP_UART2_RX_USING_DMA
default 64
endif
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
Expand Down
1 change: 1 addition & 0 deletions bsp/at32/at32m412-start/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ menu "On-chip Peripheral Drivers"
depends on RT_USING_SERIAL_V2 && BSP_UART2_RX_USING_DMA
default 64
endif
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
Expand Down
1 change: 1 addition & 0 deletions bsp/at32/at32m416-start/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ menu "On-chip Peripheral Drivers"
depends on RT_USING_SERIAL_V2 && BSP_UART2_RX_USING_DMA
default 64
endif
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
Expand Down
6 changes: 6 additions & 0 deletions bsp/essemi/es32f365x/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@
LFLAGS += ' --entry __iar_program_start'
EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = ''

def dist_handle(BSP_ROOT, dist_dir):
import sys
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)
11 changes: 11 additions & 0 deletions bsp/essemi/tools/sdk_dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os


def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files

print("=> copy es32f369x libraries")
bsp_copy_files(
os.path.join(os.path.dirname(BSP_ROOT), 'es32f369x'),
os.path.join(os.path.dirname(dist_dir), 'es32f369x'),
)
2 changes: 1 addition & 1 deletion bsp/fm33lc026/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
def dist_handle(BSP_ROOT, dist_dir):
import sys
cwd_path = os.getcwd()
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
sys.path.append(os.path.join(BSP_ROOT, 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)

2 changes: 2 additions & 0 deletions bsp/fm33lc026/tools/sdk_dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def dist_do_building(BSP_ROOT, dist_dir):
pass
25 changes: 23 additions & 2 deletions bsp/ft32/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))


def update_dist_project_paths(dist_dir):
sconstruct_path = os.path.join(dist_dir, 'SConstruct')
if not os.path.isfile(sconstruct_path):
return

with open(sconstruct_path, 'r') as f:
data = f.read()

data = data.replace("os.path.join(libraries_path_prefix, 'STD_Drivers', 'SConscript')",
"os.path.join(libraries_path_prefix, 'Drivers', 'SConscript')")
data = data.replace("variant_dir='../libraries/Drivers'",
"variant_dir='build/libraries/Drivers'")
data = data.replace('variant_dir="../libraries/Drivers"',
'variant_dir="build/libraries/Drivers"')

with open(sconstruct_path, 'w') as f:
f.write(data)


# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
Expand All @@ -14,9 +33,11 @@ def dist_do_building(BSP_ROOT, dist_dir):
print("=> copy ft32 bsp library")
library_dir = os.path.join(dist_dir, 'libraries')
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
if rtconfig.BSP_LIBRARY_TYPE is not None:
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'Drivers'), os.path.join(library_dir, 'Drivers'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
update_dist_project_paths(dist_dir)
22 changes: 21 additions & 1 deletion bsp/hc32/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@

cwd_path = os.getcwd()
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))



def update_dist_project_paths(dist_dir):
tests_sconscript = os.path.join(os.path.dirname(dist_dir), 'tests', 'SConscript')
if os.path.isfile(tests_sconscript):
with open(tests_sconscript, 'r') as f:
data = f.read()

data = data.replace('../../../components', '../project/rt-thread/components')

with open(tests_sconscript, 'w') as f:
f.write(data)


# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
Expand All @@ -20,3 +33,10 @@ def dist_do_building(BSP_ROOT, dist_dir):
print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'hc32_drivers'), os.path.join(library_dir, 'hc32_drivers'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))

print("=> copy hc32 platform")
bsp_copy_files(os.path.join(os.path.dirname(BSP_ROOT), 'platform'), os.path.join(os.path.dirname(dist_dir), 'platform'))

print("=> copy hc32 tests")
bsp_copy_files(os.path.join(os.path.dirname(BSP_ROOT), 'tests'), os.path.join(os.path.dirname(dist_dir), 'tests'))
update_dist_project_paths(dist_dir)
11 changes: 11 additions & 0 deletions bsp/hk32/tools/sdk_dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os


def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files

print("=> copy hk32 libraries")
bsp_copy_files(
os.path.join(os.path.dirname(BSP_ROOT), 'libraries'),
os.path.join(dist_dir, 'libraries'),
)
32 changes: 32 additions & 0 deletions bsp/hpmicro/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@
cwd_path = os.getcwd()
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))

def update_rtt_root_path(path):
if not os.path.isfile(path):
return

with open(path, 'r') as f:
data = f.read()

data = data.replace("RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')",
"RTT_ROOT = os.path.join(os.getcwd(), 'rt-thread')")
data = data.replace('RTT_ROOT = os.path.normpath(os.getcwd() + "/../../..")',
"RTT_ROOT = os.path.join(os.getcwd(), 'rt-thread')")

with open(path, 'w') as f:
f.write(data)


def update_dist_project_paths(dist_dir):
update_rtt_root_path(os.path.join(dist_dir, 'SConstruct'))
update_rtt_root_path(os.path.join(dist_dir, 'rtconfig.py'))

kconfig_path = os.path.join(dist_dir, 'Kconfig')
if os.path.isfile(kconfig_path):
with open(kconfig_path, 'r') as f:
data = f.read()

data = data.replace('rsource "../libraries/Kconfig"',
'rsource "libraries/Kconfig"')

with open(kconfig_path, 'w') as f:
f.write(data)

# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
Expand All @@ -15,3 +46,4 @@ def dist_do_building(BSP_ROOT, dist_dir):
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')

bsp_copy_files(library_path, library_dir)
update_dist_project_paths(dist_dir)
7 changes: 5 additions & 2 deletions bsp/ht32/libraries/HT32_STD_1xxxx_FWLib/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import rtconfig
from building import *
Import('rtconfig')

tools_path = os.path.normpath(os.getcwd() + '../../..' + '/tools')
sys.path.append(tools_path)
tools_paths = [
os.path.normpath(os.path.join(GetCurrentDir(), '..', '..', 'tools')),
os.path.normpath(os.path.join(GetCurrentDir(), '..', '..')),
]
sys.path.extend(tools_paths)
from sdk_dist import get_source

source_file_path = os.path.join(os.getcwd(), 'Source_file')
Expand Down
7 changes: 5 additions & 2 deletions bsp/ht32/libraries/HT32_STD_5xxxx_FWLib/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import rtconfig
from building import *
Import('rtconfig')

tools_path = os.path.normpath(os.getcwd() + '../../..' + '/tools')
sys.path.append(tools_path)
tools_paths = [
os.path.normpath(os.path.join(GetCurrentDir(), '..', '..', 'tools')),
os.path.normpath(os.path.join(GetCurrentDir(), '..', '..')),
]
sys.path.extend(tools_paths)
from sdk_dist import get_source

source_file_path = os.path.join(os.getcwd(), 'Source_file')
Expand Down
5 changes: 4 additions & 1 deletion bsp/ht32/tools/sdk_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ def dist_do_building(BSP_ROOT, dist_dir):
print("=> copy ht32 bsp library")
library_dir = os.path.join(dist_dir, 'libraries')
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
if rtconfig.BSP_LIBRARY_TYPE is not None:
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'ht32_drivers'), os.path.join(library_dir, 'ht32_drivers'))
bsp_copy_files(os.path.join(library_path, 'usbd_library'), os.path.join(library_dir, 'usbd_library'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
shutil.copyfile(os.path.join(os.path.dirname(BSP_ROOT), 'tools', 'sdk_dist.py'), os.path.join(dist_dir, 'sdk_dist.py'))
bsp_update_kconfig_library(dist_dir)


Expand Down
6 changes: 6 additions & 0 deletions bsp/microchip/samc21/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@

POST_ACTION = OBJCPY + ' -O binary $TARGET rt-thread-' + DEVICE_PART + '.bin\n' + SIZE + ' $TARGET \n'

def dist_handle(BSP_ROOT, dist_dir):
import sys
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)

6 changes: 6 additions & 0 deletions bsp/microchip/same54/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@

POST_ACTION = OBJCPY + ' -O binary $TARGET rt-thread-' + DEVICE_PART + '.bin\n' + SIZE + ' $TARGET \n'

def dist_handle(BSP_ROOT, dist_dir):
import sys
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)

6 changes: 6 additions & 0 deletions bsp/microchip/same70/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@

POST_ACTION = OBJCPY + ' -O binary $TARGET rt-thread-' + DEVICE_PART + '.bin\n' + SIZE + ' $TARGET \n'

def dist_handle(BSP_ROOT, dist_dir):
import sys
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
from sdk_dist import dist_do_building
dist_do_building(BSP_ROOT, dist_dir)

11 changes: 11 additions & 0 deletions bsp/microchip/tools/sdk_dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os


def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files

print("=> copy microchip common")
bsp_copy_files(
os.path.join(os.path.dirname(BSP_ROOT), 'common'),
os.path.join(os.path.dirname(dist_dir), 'common'),
)
Loading
Loading