From c8914c7f2bd4109bdb7f01f388bbc09e5e15c9a9 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 23 Jul 2024 13:58:24 +0800 Subject: [PATCH] bsp: cvitek: fixed stacksize issue In the original Sconstruct script, `GetDepend('__STACKSIZE__')` is placed before the call to `PrepareBuilding()`, which causes the value of `GetDepend('__STACKSIZE__')` to always be False, and the value of `__STACKSIZE__` in `link_stacksize.lds` will not be updated. Solution: move the call if `PrepareBuilding()` ahead. Also sync and update the .config and rtconfig.h, plus the link_stacksize.lds. Signed-off-by: Chen Wang --- bsp/cvitek/cv18xx_risc-v/.config | 66 --------------------- bsp/cvitek/cv18xx_risc-v/SConstruct | 15 ++--- bsp/cvitek/cv18xx_risc-v/link_stacksize.lds | 2 +- bsp/cvitek/cv18xx_risc-v/rtconfig.h | 12 ---- 4 files changed, 9 insertions(+), 86 deletions(-) diff --git a/bsp/cvitek/cv18xx_risc-v/.config b/bsp/cvitek/cv18xx_risc-v/.config index ff74894dde..60365a528c 100644 --- a/bsp/cvitek/cv18xx_risc-v/.config +++ b/bsp/cvitek/cv18xx_risc-v/.config @@ -1299,72 +1299,6 @@ CONFIG_RT_USING_ADT_REF=y # end of Arduino libraries # end of RT-Thread online packages -# -# Privated Packages of RealThread -# -# CONFIG_PKG_USING_CODEC is not set -# CONFIG_PKG_USING_PLAYER is not set -# CONFIG_PKG_USING_MPLAYER is not set -# CONFIG_PKG_USING_PERSIMMON_SRC is not set -# CONFIG_PKG_USING_JS_PERSIMMON is not set -# CONFIG_PKG_USING_JERRYSCRIPT_WIN32 is not set - -# -# Network Utilities -# -# CONFIG_PKG_USING_MDNS is not set -# CONFIG_PKG_USING_UPNP is not set -# end of Network Utilities - -# CONFIG_PKG_USING_WICED is not set -# CONFIG_PKG_USING_CLOUDSDK is not set -# CONFIG_PKG_USING_POWER_MANAGER is not set -# CONFIG_PKG_USING_RT_OTA is not set -# CONFIG_PKG_USING_RTINSIGHT is not set -# CONFIG_PKG_USING_SMARTCONFIG is not set -# CONFIG_PKG_USING_RTX is not set -# CONFIG_RT_USING_TESTCASE is not set -# CONFIG_PKG_USING_NGHTTP2 is not set -# CONFIG_PKG_USING_AVS is not set -# CONFIG_PKG_USING_ALI_LINKKIT is not set -# CONFIG_PKG_USING_STS is not set -# CONFIG_PKG_USING_DLMS is not set -# CONFIG_PKG_USING_AUDIO_FRAMEWORK is not set -# CONFIG_PKG_USING_ZBAR is not set -# CONFIG_PKG_USING_MCF is not set -# CONFIG_PKG_USING_URPC is not set -# CONFIG_PKG_USING_DCM is not set -# CONFIG_PKG_USING_EMQ is not set -# CONFIG_PKG_USING_CFGM is not set -# CONFIG_PKG_USING_RT_CMSIS_DAP is not set -# CONFIG_PKG_USING_SMODULE is not set -# CONFIG_PKG_USING_SNFD is not set -# CONFIG_PKG_USING_UDBD is not set -# CONFIG_PKG_USING_BENCHMARK is not set -# CONFIG_PKG_USING_UBJSON is not set -# CONFIG_PKG_USING_DATATYPE is not set -# CONFIG_PKG_USING_FASTFS is not set -# CONFIG_PKG_USING_RIL is not set -# CONFIG_PKG_USING_WATCH_DCM_SVC is not set -# CONFIG_PKG_USING_WATCH_APP_FWK is not set -# CONFIG_PKG_USING_GUI_TEST is not set -# CONFIG_PKG_USING_PMEM is not set -# CONFIG_PKG_USING_LWRDP is not set -# CONFIG_PKG_USING_MASAN is not set -# CONFIG_PKG_USING_BSDIFF_LIB is not set -# CONFIG_PKG_USING_PRC_DIFF is not set - -# -# RT-Thread Smart -# -# CONFIG_PKG_USING_UKERNEL is not set -# end of RT-Thread Smart - -# CONFIG_PKG_USING_TRACE_AGENT is not set -# CONFIG_PKG_USING_DLOG is not set -# CONFIG_PKG_USING_EXT4 is not set -# end of Privated Packages of RealThread - # # General Drivers Configuration # diff --git a/bsp/cvitek/cv18xx_risc-v/SConstruct b/bsp/cvitek/cv18xx_risc-v/SConstruct index 6ffc4cd71a..967a4e2910 100755 --- a/bsp/cvitek/cv18xx_risc-v/SConstruct +++ b/bsp/cvitek/cv18xx_risc-v/SConstruct @@ -24,13 +24,6 @@ Export('rtconfig') rtconfig.CPU='virt64' rtconfig.ARCH='risc-v' -stack_size = 4096 - -stack_lds = open('link_stacksize.lds', 'w') -if GetDepend('__STACKSIZE__'): stack_size = GetDepend('__STACKSIZE__') -stack_lds.write('__STACKSIZE__ = %d;\n' % stack_size) -stack_lds.close() - SDK_ROOT = os.path.abspath('./') if os.path.exists(SDK_ROOT + '/drivers'): @@ -44,5 +37,13 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu = False) # include libraries objs.extend(SConscript(drivers_path_prefix + '/SConscript', variant_dir='build/drivers', duplicate=0)) +stack_size = 4096 + +stack_lds = open('link_stacksize.lds', 'w') +if GetDepend('__STACKSIZE__'): + stack_size = GetDepend('__STACKSIZE__') +stack_lds.write('__STACKSIZE__ = %d;\n' % stack_size) +stack_lds.close() + # make a building DoBuilding(TARGET, objs) diff --git a/bsp/cvitek/cv18xx_risc-v/link_stacksize.lds b/bsp/cvitek/cv18xx_risc-v/link_stacksize.lds index 28438c7da1..38d573dcad 100755 --- a/bsp/cvitek/cv18xx_risc-v/link_stacksize.lds +++ b/bsp/cvitek/cv18xx_risc-v/link_stacksize.lds @@ -1 +1 @@ -__STACKSIZE__ = 4096; +__STACKSIZE__ = 8192; diff --git a/bsp/cvitek/cv18xx_risc-v/rtconfig.h b/bsp/cvitek/cv18xx_risc-v/rtconfig.h index 8932c30602..8f5a1391b4 100755 --- a/bsp/cvitek/cv18xx_risc-v/rtconfig.h +++ b/bsp/cvitek/cv18xx_risc-v/rtconfig.h @@ -439,18 +439,6 @@ /* end of Arduino libraries */ /* end of RT-Thread online packages */ -/* Privated Packages of RealThread */ - - -/* Network Utilities */ - -/* end of Network Utilities */ - -/* RT-Thread Smart */ - -/* end of RT-Thread Smart */ -/* end of Privated Packages of RealThread */ - /* General Drivers Configuration */ #define BSP_USING_UART