diff options
| -rw-r--r-- | bsp/k210/README.md | 15 | ||||
| -rw-r--r-- | bsp/k210/link.lds | 25 | ||||
| -rwxr-xr-x | bsp/k210/rtconfig.py | 2 |
3 files changed, 40 insertions, 2 deletions
diff --git a/bsp/k210/README.md b/bsp/k210/README.md index cdf0848444..4560094316 100644 --- a/bsp/k210/README.md +++ b/bsp/k210/README.md @@ -31,9 +31,22 @@ Kendryte中文含义为勘智,而勘智取自勘物探智。这颗芯片主要 ## 2. 编译说明 -编译K210,需要有RT-Thread的代码,因为K210的sdk是以软件包方式,所以需要在bsp/k210下做软件包更新。Windows下推进使用[env工具][1],然后在console下进入bsp/k210目录中,运行: +编译 K210,需要有 RT-Thread 的代码,因为 K210 的 sdk 是以软件包方式,所以需要在 bsp/k210 下做软件包更新。注意,需要使用 latest 的 RT-Thread 源码和 Latest 的软件包,软件包在menuconfig中的配置路径如下: + +``` +RT-Thread online packages ---> peripheral libraries and drivers ---> kendryte K210 SDK package for rt-thread +``` + +最新的 k210 SDK 使用了 C++17 编写了部分代码,因此需要打开 C++ 组件,C++组件在menuconfig中的配置路径如下: + +``` +RT-Thread Components ---> C++ features +``` + +Windows下推荐使用[env工具][1],然后在console下进入bsp/k210目录中,运行: cd bsp/k210 + menuconfig # 在软件包中选择最新的 k210 SDK pkgs --update 如果在Linux平台下,可以先执行 diff --git a/bsp/k210/link.lds b/bsp/k210/link.lds index bcf7681595..60b39fb5f1 100644 --- a/bsp/k210/link.lds +++ b/bsp/k210/link.lds @@ -44,6 +44,18 @@ SECTIONS *(.glue_7) *(.glue_7t) *(.gnu.linkonce.t*) + + . = ALIGN(8); + + PROVIDE(__ctors_start__ = .); + /* old GCC version uses .ctors */ + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + /* new GCC version uses .init_array */ + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE(__ctors_end__ = .); + /* section information for finsh shell */ . = ALIGN(8); @@ -63,6 +75,13 @@ SECTIONS __rt_init_end = .; . = ALIGN(8); + + __spi_func_start = .; + KEEP(*(.spi_call)) + __spi_func_end = .; + + . = ALIGN(8); + __rt_utest_tc_tab_start = .; KEEP(*(UtestTcTab)) __rt_utest_tc_tab_end = .; @@ -93,6 +112,12 @@ SECTIONS *(.sdata) *(.sdata.*) + + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + } > SRAM /* stack for dual core */ diff --git a/bsp/k210/rtconfig.py b/bsp/k210/rtconfig.py index 0f336d545e..8536011fd9 100755 --- a/bsp/k210/rtconfig.py +++ b/bsp/k210/rtconfig.py @@ -51,7 +51,7 @@ if PLATFORM == 'gcc': else: CFLAGS += ' -O2 -Os' - CXXFLAGS = CFLAGS + CXXFLAGS = CFLAGS + ' -std=gnu++17 -Wno-multichar' DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' |
