Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
a966dd3c
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
a966dd3c
编写于
8月 12, 2014
作者:
wzyy2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp]add gdb support for BBB
上级
fd6ef4b2
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
54 addition
and
4 deletion
+54
-4
bsp/beaglebone/applications/application.c
bsp/beaglebone/applications/application.c
+8
-0
bsp/beaglebone/drivers/serial.c
bsp/beaglebone/drivers/serial.c
+39
-3
bsp/beaglebone/rtconfig.h
bsp/beaglebone/rtconfig.h
+6
-0
bsp/beaglebone/rtconfig.py
bsp/beaglebone/rtconfig.py
+1
-1
未找到文件。
bsp/beaglebone/applications/application.c
浏览文件 @
a966dd3c
...
...
@@ -16,6 +16,10 @@
#include <rtthread.h>
#include <components.h>
#ifdef RT_USING_GDB
#include <gdb_stub.h>
#endif
int
rt_application_init
()
{
/* do component initialization */
...
...
@@ -23,6 +27,10 @@ int rt_application_init()
#ifdef RT_USING_NEWLIB
libc_system_init
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#ifdef RT_USING_GDB
gdb_set_device
(
"uart4"
);
gdb_start
();
#endif
return
0
;
}
bsp/beaglebone/drivers/serial.c
浏览文件 @
a966dd3c
...
...
@@ -338,6 +338,42 @@ static void config_pinmux(void)
#endif
}
static
int
am33xx_putc_poll
(
struct
rt_serial_device
*
serial
,
char
c
)
{
struct
am33xx_uart
*
uart
;
RT_ASSERT
(
serial
!=
RT_NULL
);
uart
=
(
struct
am33xx_uart
*
)
serial
->
parent
.
user_data
;
while
(
!
(
UART_LSR_REG
(
uart
->
base
)
&
0x20
));
UART_THR_REG
(
uart
->
base
)
=
c
;
return
1
;
}
static
int
am33xx_getc_poll
(
struct
rt_serial_device
*
serial
)
{
int
ch
;
struct
am33xx_uart
*
uart
;
RT_ASSERT
(
serial
!=
RT_NULL
);
uart
=
(
struct
am33xx_uart
*
)
serial
->
parent
.
user_data
;
ch
=
-
1
;
while
(
!
(
UART_LSR_REG
(
uart
->
base
)
&
0x01
));
ch
=
UART_RHR_REG
(
uart
->
base
)
&
0xff
;
return
ch
;
}
static
const
struct
rt_uart_ops
am33xx_gdb_ops
=
{
am33xx_configure
,
am33xx_control
,
am33xx_putc_poll
,
am33xx_getc_poll
,
};
int
rt_hw_serial_init
(
void
)
{
struct
serial_configure
config
;
...
...
@@ -447,17 +483,17 @@ int rt_hw_serial_init(void)
config
.
invert
=
NRZ_NORMAL
;
config
.
bufsz
=
RT_SERIAL_RB_BUFSZ
;
serial4
.
ops
=
&
am33xx_
uart
_ops
;
serial4
.
ops
=
&
am33xx_
gdb
_ops
;
serial4
.
config
=
config
;
/* enable RX interrupt */
UART_IER_REG
(
uart4
.
base
)
=
0x0
1
;
UART_IER_REG
(
uart4
.
base
)
=
0x0
0
;
/* install ISR */
rt_hw_interrupt_install
(
uart4
.
irq
,
am33xx_uart_isr
,
&
serial4
,
"uart4"
);
rt_hw_interrupt_control
(
uart4
.
irq
,
0
,
0
);
rt_hw_interrupt_mask
(
uart4
.
irq
);
/* register UART4 device */
rt_hw_serial_register
(
&
serial4
,
"uart4"
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_
INT_RX
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_
STREAM
,
&
uart4
);
#endif
...
...
bsp/beaglebone/rtconfig.h
浏览文件 @
a966dd3c
...
...
@@ -2,6 +2,12 @@
#ifndef __RTTHREAD_CFG_H__
#define __RTTHREAD_CFG_H__
// <section name="RT_USING_GDB" description="Gdb Stub for rtt" default="true" >
//#define RT_USING_GDB
//#define RT_GDB_DEBUG
#define RT_GDB_ICACHE
// </section>
// <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
// <integer name="RT_NAME_MAX" description="Maximal size of kernel object name length" default="6" />
...
...
bsp/beaglebone/rtconfig.py
浏览文件 @
a966dd3c
...
...
@@ -23,7 +23,7 @@ elif CROSS_TOOL == 'iar':
if
os
.
getenv
(
'RTT_EXEC_PATH'
):
EXEC_PATH
=
os
.
getenv
(
'RTT_EXEC_PATH'
)
BUILD
=
'
release
'
BUILD
=
'
debug
'
if
PLATFORM
==
'gcc'
:
# toolchains
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录