Skip to content

Commit f52fa6f

Browse files
committed
fix(nuclei): 更新README.md以增加SMP配置说明并调整rtconfig.py中的堆栈大小设置
默认per-core中断栈设置为4k
1 parent 5a8bffe commit f52fa6f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

bsp/nuclei/nuclei_fpga_eval/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ git clone -b nuclei/lts-v4.1.x https://github.com/riscv-mcu/rt-thread.git
9898
9999
1. 运行 ``pkgs --update``来下载最新的依赖的**Nuclei SDK**, 如果下载失败,可能需要先执行 `menuconfig` 命令来更新`.config`文件(注意需要保存),因为依赖的SDK的位置可能被上游更新。
100100
2. **可选**: 运行 ``menuconfig``来进行内核配置, 如果有**SMP需求**,则需要进行如下修改
101-
- `menuconfig` 配置 `RT-Thread Kernel` -> `Enable SMP` + `Number of CPUs` 配置正确的CPU Core个数
101+
- `menuconfig` 配置 `RT-Thread Kernel` -> `Enable SMP` + `Number of CPUs` 配置正确的CPU Core个数, 其他关于每个任务栈的配置也请在menuconfig中设置好,避免栈大小不够导致任务栈溢出。
102102
- 修改 `rtconfig.py` 里面的 `NUCLEI_SDK_SMP` 为实际运行的CPU个数,如果是SMP运行,运行模式只能是sram或者ddr模式,为了确保所有core可以访问共享的存储区域
103103
3. **务必** 运行 ``scons -c``清理之前的编译结果
104104
4. 根据你当前评估的Nuclei RISC-V内核情况,修改 ``rtconfig.py``中的``NUCLEI_SDK_CORE````NUCLEI_SDK_DOWNLOAD``参数。

bsp/nuclei/nuclei_fpga_eval/rtconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
LFLAGS = ' --specs=nano.specs --specs=nosys.specs -nostartfiles -Wl,--gc-sections '
7474
LFLAGS += ' -Wl,-cref,-Map=rtthread.map '
7575
if NUCLEI_SDK_SMP > 1:
76-
LFLAGS += ' -Wl,--defsym=__SMP_CPU_CNT=%s ' % (NUCLEI_SDK_SMP)
76+
# set stack size to 4K for each cpu, change 4k to your stack size for each cpu before main and during interrupt and exception
77+
LFLAGS += ' -Wl,--defsym=__SMP_CPU_CNT=%s -Wl,--defsym=__STACK_SIZE=4K' % (NUCLEI_SDK_SMP)
7778
LFLAGS += ' -u _isatty -u _write -u _sbrk -u _read -u _close -u _fstat -u _lseek '
7879
CPATH = ''
7980
LPATH = ''

0 commit comments

Comments
 (0)