Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
1480f729
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1480f729
编写于
1月 08, 2023
作者:
杭州_燕十三
提交者:
mysterywolf
1月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format file && update README.md
上级
9339e495
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
45 addition
and
29 deletion
+45
-29
bsp/bl808/README.md
bsp/bl808/README.md
+23
-15
bsp/bl808/m0/applications/main.c
bsp/bl808/m0/applications/main.c
+2
-2
bsp/bl808/m0/drivers/board.c
bsp/bl808/m0/drivers/board.c
+4
-4
bsp/bl808/m0/drivers/board.h
bsp/bl808/m0/drivers/board.h
+1
-1
bsp/bl808/m0/drivers/drv_uart.c
bsp/bl808/m0/drivers/drv_uart.c
+6
-6
bsp/bl808/m0/drivers/drv_uart.h
bsp/bl808/m0/drivers/drv_uart.h
+1
-1
bsp/bl808/m0/libraries/.ignore_format.yml
bsp/bl808/m0/libraries/.ignore_format.yml
+8
-0
未找到文件。
bsp/bl808/README.md
浏览文件 @
1480f729
...
...
@@ -40,15 +40,34 @@ IR remote、 Display 和 GPIO。
## 2. 编译说明
BL808是多核异构架构,每个核需要单独编译,并烧录到对应的位置。
BL808是多核异构架构,
分为m0和d0,
每个核需要单独编译,并烧录到对应的位置。
Windows下推荐使用
[
env工具
][
1
]
,然后在console下进入bsp/bl808目录中,选择需要编译的核心,m0或d0,运行:
### 2.1. 交叉编译期路径设置
下载risc-v的工具链,
[
下载地址1
](
https://occ.t-head.cn/community/download?id=4073475960903634944
)
或
[
下载地址2
](
https://dl.sipeed.com/shareURL/others/toolchain
)
Windows下请使用使用
[
env工具
][
1
]
,使用命令
`tar -xvf Xuantie-900-gcc-elf-newlib-mingw-V2.6.1-20220906.tar.gz`
解压交叉编译器,使用Windows下解压工具直接解压可能出现Windows下编译错误。
在
`rtconfig.py`
中将risc-v工具链的本地路径加入
`EXEC_PATH`
或通过
`RTT_EXEC_PATH`
环境变量指定路径
Windows:
```
set RTT_EXEC_PATH=C:\Users\xxxx\Downloads\Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1\bin
```
Linux:
```
export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1/bin
```
### 2.2. 编译
Windows下推荐使用
[
env工具
][
1
]
,在console下进入bsp/bl808目录中,选择需要编译的核心,m0或d0,运行:
cd bsp/bl808/m0
menuconfig
pkgs --update
如果在Linux平台下,可以先执行
如果在Linux平台下,可以先执行
:
scons --menuconfig
...
...
@@ -58,19 +77,8 @@ Windows下推荐使用[env工具][1],然后在console下进入bsp/bl808目录
cd bsp/bl808/m0
pkgs --update
下载risc-v的工具链,
[
下载地址
](
https://occ.t-head.cn/community/download?id=4073475960903634944
)
或
[
下载地址
](
https://dl.sipeed.com/shareURL/others/toolchain
)
更新完软件包后,在
`rtconfig.py`
中将risc-v工具链的本地路径加入文档。
然后执行scons编译:
```
set RTT_EXEC_PATH=C:\Users\xxxx\Downloads\Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1/bin
scons
```
来编译这个板级支持包。
或者通过
`scons --exec-path="GCC工具链路径"`
命令,在指定工具链位置的同时直接编译。
更新完软件包后,执行
`scons -j10`
或
`scons -j10 --verbose`
来编译这个板级支持包。
或者通过
`scons --exec-path="GCC工具链路径"`
命令,在指定工具链位置的同时直接编译。
如果编译正确无误,会产生rtthread.elf、rtthread_m0.bin文件。其中rtthread_m0.bin需要烧写到设备中进行运行。
...
...
bsp/bl808/m0/applications/main.c
浏览文件 @
1480f729
/*
* Copyright (c) 2006-202
1
, RT-Thread Development Team
* Copyright (c) 2006-202
3
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
@@ -16,4 +16,4 @@ int main(void)
rt_kprintf
(
"Hello, world
\n
"
);
return
0
;
}
\ No newline at end of file
}
bsp/bl808/m0/drivers/board.c
浏览文件 @
1480f729
/*
* Copyright (c) 2006-202
1
, RT-Thread Development Team
* Copyright (c) 2006-202
3
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
@@ -57,9 +57,9 @@ static void cmd_jtag_cpu0(void)
/* This is the timer interrupt service routine. */
static
void
mtime_handler
(
void
)
{
{
rt_tick_increase
();
csi_coret_config
(
CPU_Get_MTimer_Clock
()
/
RT_TICK_PER_SECOND
,
MTIME_IRQn
);
}
...
...
@@ -74,7 +74,7 @@ void rt_hw_board_init(void)
#ifdef RT_USING_HEAP
/* initialize memory system */
rt_system_heap_init
(
RT_HW_HEAP_BEGIN
,
RT_HW_HEAP_END
);
#endif
#endif
/* UART driver initialization is open by default */
#ifdef RT_USING_SERIAL
...
...
bsp/bl808/m0/drivers/board.h
浏览文件 @
1480f729
/*
* Copyright (c) 2006-202
1
, RT-Thread Development Team
* Copyright (c) 2006-202
3
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
bsp/bl808/m0/drivers/drv_uart.c
浏览文件 @
1480f729
/*
* Copyright (c) 2006-202
2
, RT-Thread Development Team
* Copyright (c) 2006-202
3
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
@@ -170,7 +170,7 @@ static rt_err_t _uart_configure(struct rt_serial_device *serial, struct serial_c
case
STOP_BITS_1
:
uart_cfg
.
stopBits
=
UART_STOPBITS_1
;
break
;
case
STOP_BITS_2
:
uart_cfg
.
stopBits
=
UART_STOPBITS_2
;
break
;
...
...
@@ -213,7 +213,7 @@ static rt_err_t _uart_configure(struct rt_serial_device *serial, struct serial_c
/* enable uart */
UART_AutoBaudDetection
(
id
,
0
);
UART_Enable
(
id
,
UART_TXRX
);
UART_Enable
(
id
,
UART_TXRX
);
return
RT_EOK
;
}
...
...
@@ -231,7 +231,7 @@ static rt_err_t _uart_control(struct rt_serial_device *serial, int cmd, void *ar
{
/* disable interrupt */
case
RT_DEVICE_CTRL_CLR_INT
:
bl_uart_int_disable
(
uart
->
port
);
bl_uart_int_disable
(
uart
->
port
);
bl_uart_int_rx_notify_unregister
(
uart
->
port
,
_uart_rx_irq
,
uart
);
break
;
...
...
@@ -309,10 +309,10 @@ int rt_hw_uart_init(void)
/* register USART device */
result
=
rt_hw_serial_register
(
serial
,
"uart0"
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
uart
);
RT_ASSERT
(
result
==
RT_EOK
);
#endif
return
0
;
}
\ No newline at end of file
}
bsp/bl808/m0/drivers/drv_uart.h
浏览文件 @
1480f729
/*
* Copyright (c) 2006-202
2
, RT-Thread Development Team
* Copyright (c) 2006-202
3
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
bsp/bl808/m0/libraries/.ignore_format.yml
0 → 100644
浏览文件 @
1480f729
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path
:
-
platform
-
stage
-
utils
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录