File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed
Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,18 @@ Kendryte中文含义为勘智,而勘智取自勘物探智。这颗芯片主要
3131
3232## 2. 编译说明
3333
34- 编译K210,需要有RT-Thread的代码,因为K210的sdk是以软件包方式,所以需要在bsp/k210下做软件包更新。Windows下推进使用[ env工具] [ 1 ] ,然后在console下进入bsp/k210目录中,运行:
34+ 编译 K210,需要有 RT-Thread 的代码,因为 K210 的 sdk 是以软件包方式,所以需要在 bsp/k210 下做软件包更新。注意,需要使用 latest 的 RT-Thread 源码和 Latest 的软件包,软件包在menuconfig中的配置路径如下:
35+
36+ RT-Thread online packages ---> peripheral libraries and drivers ---> kendryte K210 SDK package for rt-thread 。
37+
38+ 最新的 k210 SDK 使用了 C++17 编写了部分代码,因此需要打开 C++ 组件,C++组件在menuconfig中的配置路径如下:
39+
40+ RT-Thread Components ---> C++ features
41+
42+ Windows下推进使用[ env工具] [ 1 ] ,然后在console下进入bsp/k210目录中,运行:
3543
3644 cd bsp/k210
45+ menuconfig # 在软件包中选择最新的 k210 SDK
3746 pkgs --update
3847
3948如果在Linux平台下,可以先执行
Original file line number Diff line number Diff line change @@ -44,6 +44,18 @@ SECTIONS
4444 *(.glue_7 )
4545 *(.glue_7t )
4646 *(.gnu .linkonce .t *)
47+
48+ . = ALIGN (8 );
49+
50+ PROVIDE (__ctors_start__ = .);
51+ /* old GCC version uses .ctors */
52+ KEEP (*(SORT (.ctors .*)))
53+ KEEP (*(.ctors ))
54+ /* new GCC version uses .init_array */
55+ KEEP (*(SORT (.init_array .*)))
56+ KEEP (*(.init_array ))
57+ PROVIDE (__ctors_end__ = .);
58+
4759
4860 /* section information for finsh shell */
4961 . = ALIGN (8 );
@@ -63,6 +75,13 @@ SECTIONS
6375 __rt_init_end = .;
6476 . = ALIGN (8 );
6577
78+
79+ __spi_func_start = .;
80+ KEEP (*(.spi_call ))
81+ __spi_func_end = .;
82+
83+ . = ALIGN (8 );
84+
6685 __rt_utest_tc_tab_start = .;
6786 KEEP (*(UtestTcTab))
6887 __rt_utest_tc_tab_end = .;
@@ -93,6 +112,12 @@ SECTIONS
93112
94113 *(.sdata )
95114 *(.sdata .*)
115+
116+ PROVIDE (__dtors_start__ = .);
117+ KEEP (*(SORT (.dtors .*)))
118+ KEEP (*(.dtors ))
119+ PROVIDE (__dtors_end__ = .);
120+
96121 } > SRAM
97122
98123 /* stack for dual core */
Original file line number Diff line number Diff line change 1515
1616if CROSS_TOOL == 'gcc' :
1717 PLATFORM = 'gcc'
18- EXEC_PATH = r'/opt/gnu-mcu-eclipse/ riscv-none-gcc/8.2 .0-2.1-20190425-1021/ bin'
18+ EXEC_PATH = r'D:\K210\xpack- riscv-none-embed- gcc-8.3 .0-1.2-win32-x64\xpack-riscv-none-embed-gcc-8.3.0-1.2\ bin'
1919else :
2020 print ('Please make sure your toolchains is GNU GCC!' )
2121 exit (0 )
5151 else :
5252 CFLAGS += ' -O2 -Os'
5353
54- CXXFLAGS = CFLAGS
54+ CXXFLAGS = CFLAGS + ' -std=gnu++17 -Wno-multichar'
5555
5656DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n '
5757POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n ' + SIZE + ' $TARGET \n '
You can’t perform that action at this time.
0 commit comments