Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yunke120
rt-thread
提交
a64f36f1
R
rt-thread
项目概览
yunke120
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a64f36f1
编写于
9月 02, 2020
作者:
嵌入式AIoT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bsp/nuclei: Fix issues mentioned in PR #3868
Signed-off-by:
Huaqi Fang
<
578567190@qq.com
>
上级
bc3471e8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
108 deletion
+32
-108
bsp/nuclei/hbird_eval/README.md
bsp/nuclei/hbird_eval/README.md
+24
-26
bsp/nuclei/hbird_eval/SConscript
bsp/nuclei/hbird_eval/SConscript
+0
-2
bsp/nuclei/hbird_eval/applications/main.c
bsp/nuclei/hbird_eval/applications/main.c
+7
-79
bsp/nuclei/libraries/hbird/HAL_Drivers/drv_uart.c
bsp/nuclei/libraries/hbird/HAL_Drivers/drv_uart.c
+1
-1
未找到文件。
bsp/nuclei/hbird_eval/README.md
浏览文件 @
a64f36f1
...
@@ -94,16 +94,16 @@ Nuclei OpenOCD, i386 Open On-Chip Debugger 0.10.0+dev-g11f0cf429 (2020-07-15-04:
...
@@ -94,16 +94,16 @@ Nuclei OpenOCD, i386 Open On-Chip Debugger 0.10.0+dev-g11f0cf429 (2020-07-15-04:
Licensed under GNU GPL v2
Licensed under GNU GPL v2
For bug reports, read
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
http://openocd.org/doc/doxygen/bugs.html
rt_
thread_idle_entry (parameter=<optimized out>) at D:\workspace\Sourcecode\rt-thread\src\idle.c:24
9
rt_
list_insert_before (n=0xdeadbeef, l=0x90000f80 <timer_thread_stack+464>) at D:\workspace\Sourcecode\rt-thread\include/rtservice.h:7
9
249 for (i = 0; i < RT_IDLE_HOOK_LIST_SIZE; i++)
79 n->next = l;
cleared protection for sectors 0 through 63 on flash bank 0
cleared protection for sectors 0 through 63 on flash bank 0
Loading section .init, size 0x284 lma 0x80000000
Loading section .init, size 0x284 lma 0x80000000
Loading section .text, size 0xb
57e
lma 0x800002c0
Loading section .text, size 0xb
30a
lma 0x800002c0
Loading section .rodata, size 0x3248 lma 0x8000b
84
0
Loading section .rodata, size 0x3248 lma 0x8000b
5d
0
Loading section .data, size 0x3
50 lma 0x8000ea8
8
Loading section .data, size 0x3
40 lma 0x8000e81
8
Start address 0x80000198, load size 60
826
Start address 0x80000198, load size 60
182
Transfer rate: 4
9 KB/sec, 10137
bytes/write.
Transfer rate: 4
8 KB/sec, 10030
bytes/write.
shutdown command invoked
shutdown command invoked
A debugging session is active.
A debugging session is active.
...
@@ -140,12 +140,10 @@ msh />
...
@@ -140,12 +140,10 @@ msh />
msh />ps
msh />ps
thread pri status sp stack size max used left tick error
thread pri status sp stack size max used left tick error
-------- --- ------- ---------- ---------- ------ ---------- ---
-------- --- ------- ---------- ---------- ------ ---------- ---
thread01 19 suspend 0x00000158 0x0000018c 87% 0x00000005 000
serrxsim 5 suspend 0x00000134 0x0000018c 77% 0x00000005 000
thread00 19 suspend 0x00000158 0x0000018c 87% 0x00000005 000
tshell 20 running 0x000002b0 0x00001000 17% 0x00000005 000
tshell 20 running 0x00000258 0x00001000 18% 0x00000004 000
tidle0 31 ready 0x00000164 0x0000018c 89% 0x0000000b 000
tidle0 31 ready 0x000000a8 0x0000018c 59% 0x0000000e 000
timer 4 suspend 0x00000120 0x00000200 56% 0x00000009 000
timer 4 suspend 0x000000f8 0x00000200 49% 0x00000009 000
main 10 suspend 0x00000168 0x00000800 36% 0x00000006 000
msh />
msh />
~~~
~~~
...
@@ -182,26 +180,26 @@ Nuclei OpenOCD, i386 Open On-Chip Debugger 0.10.0+dev-g11f0cf429 (2020-07-15-04:
...
@@ -182,26 +180,26 @@ Nuclei OpenOCD, i386 Open On-Chip Debugger 0.10.0+dev-g11f0cf429 (2020-07-15-04:
Licensed under GNU GPL v2
Licensed under GNU GPL v2
For bug reports, read
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
http://openocd.org/doc/doxygen/bugs.html
0x0000000080000f14 in _has_defunct_thread () at D:\workspace\Sourcecode\rt-thread\src\idle.c:153
0x0000000080000e80 in rt_thread_idle_entry (parameter=<optimized out>)
153 while (_has_defunct_thread())
at D:\workspace\Sourcecode\rt-thread\src\idle.c:253
253 idle_hook_list[i]();
(gdb) load
(gdb) load
Loading section .init, size 0x284 lma 0x80000000
Loading section .init, size 0x284 lma 0x80000000
Loading section .text, size 0xb
57e
lma 0x800002c0
Loading section .text, size 0xb
30a
lma 0x800002c0
Loading section .rodata, size 0x3248 lma 0x8000b
84
0
Loading section .rodata, size 0x3248 lma 0x8000b
5d
0
Loading section .data, size 0x3
50 lma 0x8000ea8
8
Loading section .data, size 0x3
40 lma 0x8000e81
8
Start address 0x80000198, load size 60
826
Start address 0x80000198, load size 60
182
Transfer rate: 4
8 KB/sec, 10137
bytes/write.
Transfer rate: 4
9 KB/sec, 10030
bytes/write.
(gdb) b main
(gdb) b main
Breakpoint 1 at 0x800002c0: file applications\main.c, line
9
5.
Breakpoint 1 at 0x800002c0: file applications\main.c, line
3
5.
(gdb) c
(gdb) c
Continuing.
Continuing.
Breakpoint 1, main () at applications\main.c:
9
5
Breakpoint 1, main () at applications\main.c:
3
5
95 board_gpio
_init();
35 board_serial
_init();
(gdb) n
(gdb) n
96 create_thread_demo();
rt_thread_exit () at D:\workspace\Sourcecode\rt-thread\src\thread.c:277
(gdb) n
277 return rt_current_thread;
99 board_serial_init();
(gdb) c
(gdb) c
Continuing.
Continuing.
~~~
~~~
...
...
bsp/nuclei/hbird_eval/SConscript
浏览文件 @
a64f36f1
...
@@ -7,8 +7,6 @@ cwd = GetCurrentDir()
...
@@ -7,8 +7,6 @@ cwd = GetCurrentDir()
objs
=
[]
objs
=
[]
list
=
os
.
listdir
(
cwd
)
list
=
os
.
listdir
(
cwd
)
ASFLAGS
=
' -I'
+
cwd
for
d
in
list
:
for
d
in
list
:
path
=
os
.
path
.
join
(
cwd
,
d
)
path
=
os
.
path
.
join
(
cwd
,
d
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
'SConscript'
)):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
'SConscript'
)):
...
...
bsp/nuclei/hbird_eval/applications/main.c
浏览文件 @
a64f36f1
...
@@ -5,84 +5,25 @@
...
@@ -5,84 +5,25 @@
*
*
* Change Logs:
* Change Logs:
* Date Author Notes
* Date Author Notes
* 20
19-07-23 tyustli
first version
* 20
20-09-02 hqfang
first version
*/
*/
#include <rtthread.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <rtdevice.h>
#include <nuclei_sdk_hal.h>
#include <nuclei_sdk_hal.h>
#define THREAD_PRIORITY 19
#define THREAD_STACK_SIZE 396
#define THREAD_TIMESLICE 5
#define THREAD_NUM 2
// #define APP_DEBUG_PRINT
/* Align stack when using static thread */
ALIGN
(
RT_ALIGN_SIZE
)
static
rt_uint8_t
thread_stack
[
THREAD_NUM
][
THREAD_STACK_SIZE
];
static
struct
rt_thread
tid
[
THREAD_NUM
];
/* Thread entry function */
static
void
thread_entry
(
void
*
parameter
)
{
rt_uint32_t
count
=
0
;
while
(
1
)
{
#ifdef APP_DEBUG_PRINT
rt_kprintf
(
"thread %d count: %d
\n
"
,
(
rt_uint32_t
)
parameter
,
count
++
);
#endif
rt_thread_mdelay
(
500
);
if
(((
uint32_t
)
parameter
)
%
2
)
{
gpio_toggle
(
GPIO
,
SOC_LED_BLUE_GPIO_MASK
);
}
else
{
gpio_toggle
(
GPIO
,
SOC_LED_GREEN_GPIO_MASK
);
}
}
}
/* Thread demo */
int
create_thread_demo
(
void
)
{
int
i
;
static
char
tname
[
9
]
=
"thread"
;
for
(
i
=
0
;
i
<
THREAD_NUM
;
i
++
)
{
/* Create static threads */
tname
[
6
]
=
i
/
10
+
'0'
;
tname
[
7
]
=
i
%
10
+
'0'
;
tname
[
8
]
=
'\0'
;
rt_thread_init
(
&
tid
[
i
],
tname
,
thread_entry
,
(
void
*
)
i
,
thread_stack
[
i
],
THREAD_STACK_SIZE
,
THREAD_PRIORITY
,
THREAD_TIMESLICE
);
}
/* Startup threads */
for
(
i
=
0
;
i
<
THREAD_NUM
;
i
++
)
{
rt_thread_startup
(
&
tid
[
i
]);
}
return
0
;
}
void
board_gpio_init
(
void
)
{
gpio_enable_input
(
GPIO
,
SOC_BUTTON_GPIO_MASK
);
gpio_set_pue
(
GPIO
,
SOC_BUTTON_GPIO_MASK
,
GPIO_BIT_ALL_ONE
);
gpio_enable_output
(
GPIO
,
SOC_LED_GPIO_MASK
);
gpio_write
(
GPIO
,
SOC_LED_GPIO_MASK
,
GPIO_BIT_ALL_ZERO
);
}
#ifdef RT_USING_SERIAL
#ifdef RT_USING_SERIAL
/* Currently UART IRQ is not connected,
#define SERIAL_THREAD_STACK_SIZE 396
* So I use task to interact with uart input
*/
#define SERIAL_THREAD_STACK_SIZE 396
static
rt_uint8_t
serial_stack
[
SERIAL_THREAD_STACK_SIZE
];
static
rt_uint8_t
serial_stack
[
SERIAL_THREAD_STACK_SIZE
];
static
struct
rt_thread
serial_tid
;
static
struct
rt_thread
serial_tid
;
extern
void
rt_hw_serial_
thread_entry
(
void
*
parameter
);
extern
void
rt_hw_serial_
rcvtsk
(
void
*
parameter
);
void
board_serial_init
(
void
)
void
board_serial_init
(
void
)
{
{
rt_thread_init
(
&
serial_tid
,
"serrxsim"
,
rt_hw_serial_
thread_entry
,
rt_thread_init
(
&
serial_tid
,
"serrxsim"
,
rt_hw_serial_
rcvtsk
,
(
void
*
)
NULL
,
serial_stack
,
SERIAL_THREAD_STACK_SIZE
,
5
,
5
);
(
void
*
)
NULL
,
serial_stack
,
SERIAL_THREAD_STACK_SIZE
,
5
,
5
);
rt_thread_startup
(
&
serial_tid
);
rt_thread_startup
(
&
serial_tid
);
}
}
...
@@ -90,22 +31,9 @@ void board_serial_init(void)
...
@@ -90,22 +31,9 @@ void board_serial_init(void)
int
main
(
void
)
int
main
(
void
)
{
{
rt_uint32_t
count
=
0
;
board_gpio_init
();
create_thread_demo
();
#ifdef RT_USING_SERIAL
#ifdef RT_USING_SERIAL
board_serial_init
();
board_serial_init
();
#endif
/* RT_USING_SERIAL */
#endif
/* RT_USING_SERIAL */
while
(
1
)
{
#ifdef APP_DEBUG_PRINT
rt_kprintf
(
"Main thread count: %d
\n
"
,
count
++
);
#endif
rt_thread_mdelay
(
1000
);
gpio_toggle
(
GPIO
,
SOC_LED_RED_GPIO_MASK
);
}
}
}
/******************** end of file *******************/
/******************** end of file *******************/
...
...
bsp/nuclei/libraries/hbird/HAL_Drivers/drv_uart.c
浏览文件 @
a64f36f1
...
@@ -219,7 +219,7 @@ int rt_hw_uart_init(void)
...
@@ -219,7 +219,7 @@ int rt_hw_uart_init(void)
return
result
;
return
result
;
}
}
void
rt_hw_serial_
thread_entry
(
void
*
parameter
)
void
rt_hw_serial_
rcvtsk
(
void
*
parameter
)
{
{
struct
hbird_uart_config
*
uart_cfg
;
struct
hbird_uart_config
*
uart_cfg
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录