summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreedyhao <[email protected]>2020-12-11 18:33:09 +0800
committergreedyhao <[email protected]>2020-12-11 18:33:09 +0800
commitec060312b7fe73859227eb17b01eb6362cdfb136 (patch)
tree9a496721fe58d39cbd1c1fddffc30059353a55a9
parent51bba95ef87e62847a581f544a6effbb67e98151 (diff)
[bluetrum] add --dist
-rw-r--r--bsp/bluetrum/ab32vg1-ab-prougen/.gitignore1
-rw-r--r--bsp/bluetrum/ab32vg1-ab-prougen/README.md2
-rw-r--r--bsp/bluetrum/ab32vg1-ab-prougen/SConstruct2
-rw-r--r--bsp/bluetrum/ab32vg1-ab-prougen/cconfig.h11
-rw-r--r--bsp/bluetrum/ab32vg1-ab-prougen/rtconfig.py9
-rw-r--r--bsp/bluetrum/libcpu/cpu/SConscript (renamed from bsp/bluetrum/libcpu/SConscript)0
-rw-r--r--bsp/bluetrum/libcpu/cpu/context_gcc.S (renamed from bsp/bluetrum/libcpu/context_gcc.S)0
-rw-r--r--bsp/bluetrum/libcpu/cpu/cpuport.c (renamed from bsp/bluetrum/libcpu/cpuport.c)0
-rw-r--r--bsp/bluetrum/libcpu/cpu/interrupt.c (renamed from bsp/bluetrum/libcpu/interrupt.c)0
-rw-r--r--bsp/bluetrum/tools/sdk_dist.py24
10 files changed, 45 insertions, 4 deletions
diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/.gitignore b/bsp/bluetrum/ab32vg1-ab-prougen/.gitignore
index 00b6f02b70..37749b0928 100644
--- a/bsp/bluetrum/ab32vg1-ab-prougen/.gitignore
+++ b/bsp/bluetrum/ab32vg1-ab-prougen/.gitignore
@@ -7,3 +7,4 @@
*.old
build
+dist
diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/README.md b/bsp/bluetrum/ab32vg1-ab-prougen/README.md
index 35f08e20bb..d761cfce45 100644
--- a/bsp/bluetrum/ab32vg1-ab-prougen/README.md
+++ b/bsp/bluetrum/ab32vg1-ab-prougen/README.md
@@ -102,7 +102,7 @@ msh >
## 注意事项
-目前的 `cconfig.h` 的生成脚本对 riscv 的工具链识别有问题,可能需要在 `cconfig.h` 中手动添加以下配置
+编译报错的时候,如果出现重复定义的报错,可能需要在 `cconfig.h` 中手动添加以下配置
```
#define HAVE_SIGEVENT 1
diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/SConstruct b/bsp/bluetrum/ab32vg1-ab-prougen/SConstruct
index 8afae966f8..697488940c 100644
--- a/bsp/bluetrum/ab32vg1-ab-prougen/SConstruct
+++ b/bsp/bluetrum/ab32vg1-ab-prougen/SConstruct
@@ -55,7 +55,7 @@ objs.extend(SConscript(os.path.join(libraries_path_prefix, bsp_library_type, 'SC
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'hal_drivers', 'SConscript')))
# include drivers
-objs.extend(SConscript(os.path.join(libcpu_path_prefix, 'SConscript')))
+objs.extend(SConscript(os.path.join(libcpu_path_prefix, 'cpu', 'SConscript')))
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/cconfig.h b/bsp/bluetrum/ab32vg1-ab-prougen/cconfig.h
index 9c81dd397d..074cbd3397 100644
--- a/bsp/bluetrum/ab32vg1-ab-prougen/cconfig.h
+++ b/bsp/bluetrum/ab32vg1-ab-prougen/cconfig.h
@@ -3,10 +3,19 @@
/* Automatically generated file; DO NOT EDIT. */
/* compiler configure file for RT-Thread in GCC*/
+#define HAVE_NEWLIB_H 1
+#define LIBC_VERSION "newlib 3.2.0"
-#define STDC "1989"
+#define HAVE_SYS_SIGNAL_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_PTHREAD_H 1
+
+#define HAVE_FDSET 1
+#define HAVE_SIGACTION 1
#define HAVE_SIGEVENT 1
#define HAVE_SIGINFO 1
#define HAVE_SIGVAL 1
+#define GCC_VERSION_STR "10.1.0"
+#define STDC "2011"
#endif
diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/rtconfig.py b/bsp/bluetrum/ab32vg1-ab-prougen/rtconfig.py
index b782e0d2c2..300d845047 100644
--- a/bsp/bluetrum/ab32vg1-ab-prougen/rtconfig.py
+++ b/bsp/bluetrum/ab32vg1-ab-prougen/rtconfig.py
@@ -57,4 +57,11 @@ if PLATFORM == 'gcc':
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
-POST_ACTION += './riscv32-elf-xmaker -b rtthread.xm\n' \ No newline at end of file
+POST_ACTION += './riscv32-elf-xmaker -b rtthread.xm\n'
+
+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'))
+ from sdk_dist import dist_do_building
+ dist_do_building(BSP_ROOT, dist_dir)
diff --git a/bsp/bluetrum/libcpu/SConscript b/bsp/bluetrum/libcpu/cpu/SConscript
index 9ff30a796b..9ff30a796b 100644
--- a/bsp/bluetrum/libcpu/SConscript
+++ b/bsp/bluetrum/libcpu/cpu/SConscript
diff --git a/bsp/bluetrum/libcpu/context_gcc.S b/bsp/bluetrum/libcpu/cpu/context_gcc.S
index 9139657eaa..9139657eaa 100644
--- a/bsp/bluetrum/libcpu/context_gcc.S
+++ b/bsp/bluetrum/libcpu/cpu/context_gcc.S
diff --git a/bsp/bluetrum/libcpu/cpuport.c b/bsp/bluetrum/libcpu/cpu/cpuport.c
index 576401421a..576401421a 100644
--- a/bsp/bluetrum/libcpu/cpuport.c
+++ b/bsp/bluetrum/libcpu/cpu/cpuport.c
diff --git a/bsp/bluetrum/libcpu/interrupt.c b/bsp/bluetrum/libcpu/cpu/interrupt.c
index 1903ec25ce..1903ec25ce 100644
--- a/bsp/bluetrum/libcpu/interrupt.c
+++ b/bsp/bluetrum/libcpu/cpu/interrupt.c
diff --git a/bsp/bluetrum/tools/sdk_dist.py b/bsp/bluetrum/tools/sdk_dist.py
new file mode 100644
index 0000000000..e40064fb84
--- /dev/null
+++ b/bsp/bluetrum/tools/sdk_dist.py
@@ -0,0 +1,24 @@
+import os
+import sys
+import shutil
+cwd_path = os.getcwd()
+sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
+
+# 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')
+
+ print("=> copy bluetrum bsp library")
+ library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
+ library_dir = os.path.join(dist_dir, 'libraries')
+ 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 libcpu")
+ bsp_copy_files(os.path.join(os.path.dirname(BSP_ROOT), 'libcpu'), os.path.join(dist_dir, 'libcpu'))