Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
BSP
RTT移植相关问题
发布于 2020-04-07 12:22:31 浏览:1129
订阅该版
hi, 各位大神, 我移植了RT-Thread,目前时钟tick 能正常中断进入。main也能跑起来了。 但是无法跑多线程。 谁能告诉我应该怎么继续调试下去? 谢谢 现象: 1 rt_thread_sleep或者 rt_thread_mdelay() 就无反馈了,一直再idle中出不来。 2 多线程也只能执行第后面的那个。下面的是程序。 int main(int argc, char** argv) { int count = 1; rt_kprintf("Hi, this is RT-Thread!!
"); thread_sample(); return RT_EOK; // while (count++) while (1) { // set_led(1); // rt_thread_sleep(10); // set_led(0); rt_thread_delay(3); rt_kprintf("RT-Thread-1
"); } return RT_EOK; } #define THREAD_PRIORITY 25 #define THREAD_STACK_SIZE 512 #define THREAD_TIMESLICE 5 /* 使用静态线程时,线程的栈需要设置字节对齐 */ ALIGN(RT_ALIGN_SIZE) static rt_uint8_t thread_stack[THREAD_STACK_SIZE]; static struct rt_thread tid1; static rt_uint8_t thread2_stack[THREAD_STACK_SIZE]; static struct rt_thread tid2; /* 线程 1 的入口函数 */ static void thread1_entry(void *parameter) { rt_uint32_t count = 0; while (1) { rt_kprintf("thread1 count: %d
", count ++); // rt_thread_mdelay(500); } } /* 线程 1 的入口函数 */ static void thread2_entry(void *parameter) { rt_uint32_t count = 0; while (1) { rt_kprintf("thread2 count: %d
", count ++); // rt_thread_mdelay(500); } } /* 线程示例 */ int thread_sample(void) { /* 静态创建线程 */ /* 初始化线程 1,名称是 thread1,入口是 thread1_entry*/ rt_thread_init(&tid1, "thread1", thread1_entry, RT_NULL, thread_stack, THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE); rt_thread_init(&tid2, "thread2", thread2_entry, RT_NULL, thread2_stack, THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE); /* 启动线程 */ rt_thread_startup(&tid1); rt_thread_startup(&tid2); return 0; } ======================== heap: 0x000a900c - 0x040a900c \ | / - RT - Thread Operating System / | \ 4.0.3 build Apr 7 2020 2006 - 2020 Copyright by rt-thread team startup a thread:main with priority:10 thread resume: main startup a thread:tidle0 with priority:31 thread resume: tidle0 Hi, this is RT-Thread!! startup a thread:thread1 with priority:25 thread resume: thread1 startup a thread:thread2 with priority:25 thread resume: thread2 thread1 count: 0 thread1 count: 1 thread1 cothread2 count: 0 thread2 count: 1 thread2 count: 2 thread2 count: 3 thread2 count: 4 thread2 count: 5 thread2 count: 6 thread2 count: 7 thread2 count: 8 thread2 count: 9
查看更多
6
个回答
默认排序
按发布时间排序
aozima
2020-04-07
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
啥芯片? 多少FLASH?多少RAM? 检查下RAM配置是否正确吧?
WETG_5647
2020-04-07
这家伙很懒,什么也没写!
Cortex-A55 DDR 2G, 程序都再DDR中的。 能帮忙指导下思路吗?
aozima
2020-04-07
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
重点检查中断映射吧。 打印时把tick值也打印下。
WETG_5647
2020-04-07
这家伙很懒,什么也没写!
>重点检查中断映射吧。 >打印时把tick值也打印下。 --- 谢谢高手指点,中断切换没做好,修改后已经成功延时,多任务切换也正常了。
aozima
2020-04-08
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
给楼主点赞!
WETG_5647
2020-04-09
这家伙很懒,什么也没写!
给版主点赞~现在RTT跑的很稳定。
撰写答案
登录
注册新账号
关注者
0
被浏览
1.1k
关于作者
WETG_5647
这家伙很懒,什么也没写!
提问
1
回答
3
被采纳
0
关注TA
发私信
相关问题
1
STM32 407 串口接收数据 系统卡死
2
RTT nrf24l01 设备驱动程序
3
stm32f10x串口只能发送数据,无法接收
4
第一次尝试移植rt-thread 到stm32F103系列问题
5
有人把stm32L07xx的bsp移到rtt上来了吗?求一个
6
rt-thread线程调度异常在stm32f103芯片上
7
RTT是否支持STM32F429
8
请问谁有 STM32F40x HAL + RT-THREAD 模板
9
rt-thread在stm32f411下的移植问题
10
针对STM32F7系列平台的MPU,Cache特性,需要注意哪些问题?
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
RTT串口查找函数使用过程中遇到的问题。
2
RT-Thread CI编译产物artifacts自动上传功能介绍
3
STM32G030移植RT-Thread
4
CubeMX & RT-Thread Studio 联合开发说明
5
RT-Thread项目助手v0.3 | Ubuntu与MacOS平台的RT-Thread Env
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
rt-smart
RTC
FAL
I2C_IIC
cubemx
ESP8266
UART
WIZnet_W5500
ota在线升级
PWM
BSP
flash
freemodbus
packages_软件包
潘多拉开发板_Pandora
GD32
定时器
ADC
flashDB
编译报错
socket
中断
rt_mq_消息队列_msg_queue
keil_MDK
Debug
SFUD
ulog
msh
C++_cpp
MicroPython
本月问答贡献
出出啊
1522
个答案
343
次被采纳
小小李sunny
1444
个答案
290
次被采纳
张世争
814
个答案
179
次被采纳
crystal266
555
个答案
162
次被采纳
whj467467222
1222
个答案
149
次被采纳
本月文章贡献
出出啊
1
篇文章
6
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
3
次点赞
crystal266
2
篇文章
1
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部