Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
Kernel
接收邮箱出问题
发布于 2016-08-18 21:10:04 浏览:2611
订阅该版
调试信息如下,gnss线程等待邮箱,一开始都可以收到邮件,可是运行一段时间后,明明有邮箱却切换不回GNSS线程。 > [1]switch to priority#1 thread:gnss(sp:0x20001578), from thread:tidle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: gnss remove thread[gnss], the priority: 1 mb_recv: start timer of thread:gnss [0]switch to priority#31 thread:tidle(sp:0x20000540), from thread:gnss(sp: 0x20001578) resume thread:gnss thread resume: gnss insert thread[gnss], the priority: 1 [1]switch to priority#1 thread:gnss(sp:0x20001578), from thread:tidle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: gnss remove thread[gnss], the priority: 1 mb_recv: start timer of thread:gnss [0]switch to priority#31 thread:tidle(sp:0x20000540), from thread:gnss(sp: 0x20001578) resume thread:?thread resume: ?insert thread[怾, the priority: 1 [1]switch to priority#1 thread:?sp:0xx20001578), from thread:tidle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: ?remove threadd[怾, the priority: 1 mb_recv: start timer of thread:?[0]sswitch to priority#31 thread:tidle(sp:0x20000540), from thread:?sp: 0x20001578) resume thread:?threaad resume: ?insert tthread[怾, the priority: 1 [1]switch to priority#1 thread:?sp:0x200015778), from thread:tidle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: ?remove thread[[怾, the priority: 1 mb_recv: start timer of thread:?[0]switch to priority#31 thread:tidle(sp:0x20000530), from thread:?sp: 0x20001578) resume thread:?thread resume: ?insert thrread[怾, the priority: 1 [1]switch to priority#1 thread:?spp:0x20001578), from thread:tidle(sp: 0x20000530) switch in interrupt mb gnss read gnss while gnss thread suspend: ?remove thread[怾, thee priority: 1 mb_recv: start timer of thread:? [0]switch to priority#31 thread:tidle(sp:0x20000540), from thread:?sp: 0x20001578) resume thread:?thread resume: ?insnsert thread[怾, the priority: 1 [1]switch to priority#1 thread:?sp:0x20001578)), from thread:tidle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: ?remove thhread[怾, the priority: 1 mb_recv: start timer of thread:?[0]switch to priiority#31 thread:tidle(sp:0x20000540), from thread:?(sp: 0x20001578) resume thread:?thread resume: ?insert t thread[怾, the priority: 1 [1]switch to priority#1 thread:?sp:0x200001578), from thread:tidle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: ?remove thread[怾, the priority: 1 mb_recv: start timer of thread:? [0]switch to priority#31 thread:tidle(sp:0x20000540), from thread:?sp: 0x20001578) resume thread:?thread resume: ?insert thread[怾, the ppriority: 1 [1]switch to priority#1 thread:?sp:0x20001578), from thread:tidlle(sp: 0x20000540) switch in interrupt mb gnss read gnss while gnss thread suspend: ? remove thread[怾, the priority: 1 mb_recv: start timer of thread:?[0]swiitch to priority#31 thread:tidle(sp:0x20000530), from thread:?sp: 00x20001578) resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 resume thread:觍 thread resume: 觍 thread resume: thread disorder, 211 (thread->stat == RT_THREAD_SUSPEND) assertion failed at function:rt_thread_timeout, line number:644 贴一段代码: > ``` static rt_err_t Gnss_UartRxInd(rt_device_t dev,rt_size_t size) { rt_mb_send(&Gnss_UartRxMb, size); return RT_EOK; } void Gnss_Thread(void *parameter) { rt_device_t uart_dev; nmeaINFO info; nmeaPARSER parser; char buff[1024] = {0}; rt_uint32_t uart_rx_sz = 0; GPIO_InitTypeDef GPIO_InitStructure; rt_mb_init(&Gnss_UartRxMb, "mbgps", Gnss_MbPool, sizeof(Gnss_MbPool), RT_IPC_FLAG_FIFO); Uart_Config(UART4, 9600, 1024, 0, RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX); uart_dev = rt_device_find(GNSS_USE_UART); rt_device_set_rx_indicate(uart_dev, Gnss_UartRxInd); nmea_zero_INFO(&info); nmea_parser_init(&parser); RCC_AHB1PeriphClockCmd(GNSS_PWR_GPIO_CLK, ENABLE); GPIO_InitStructure.GPIO_Mode=GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_OType=GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_UP; GPIO_InitStructure.GPIO_Pin=GNSS_PWR_GPIO_PIN; GPIO_Init(GNSS_PWR_GPIO, &GPIO_InitStructure); GNSS_Reset(); while(1) { rt_kprintf("while gnss "); // rt_mb_recv(&Gnss_UartRxMb, &uart_rx_sz, RT_WAITING_FOREVER); if(rt_mb_recv(&Gnss_UartRxMb, &uart_rx_sz, 10 * RT_TICK_PER_SECOND) == RT_EOK) { rt_kprintf("mb gnss "); rt_memset(buff, 0, sizeof(buff)); uart_rx_sz = rt_device_read(uart_dev, 0, buff, sizeof(buff)); rt_kprintf("read gnss "); if(uart_rx_sz) { // rt_kprintf(" %s ", buff); nmea_parse(&parser, buff, (int)uart_rx_sz, &info); } } else { /* reset */ GNSS_Reset(); } } } void Gnss_Init(void) { /* 线程1控制块 */ static struct rt_thread gnss_thread; /* 线程1栈 */ ALIGN(4) static rt_uint8_t gnss_thread_stack[GNSS_THREAD_STACK_SIZE]; rt_err_t result; result = rt_thread_init(&gnss_thread, "gnss", Gnss_Thread, RT_NULL, gnss_thread_stack, GNSS_THREAD_STACK_SIZE, 1, 20); if (result == RT_EOK) /* 如果返回正确,启动线程 */ { rt_thread_startup(&gnss_thread); } }```
查看更多
2
个回答
默认排序
按发布时间排序
SimonLeung
2016-08-18
这家伙很懒,什么也没写!
找到了,自问自答,由于以下 >``` > > rt_mb_init(&Gnss_UartRxMb, "mbgps", Gnss_MbPool, sizeof(Gnss_MbPool), RT_IPC_FLAG_FIFO); >``` --- 正确的应该如下 >``` > > rt_mb_init(&Gnss_UartRxMb, "mbgps", Gnss_MbPool, sizeof(Gnss_MbPool) / 4, RT_IPC_FLAG_FIFO); >``` --- 然后变量的地址 >Gnss_UartRxMb 0x200008a4 Data 48 gnss.o(.bss) > Gnss_MbPool 0x200008d4 Data 200 gnss.o(.bss) > gnss_thread 0x2000099c Data 128 gnss.o(.bss) > gnss_thread_stack 0x20000a1c Data 4096 gnss.o(.bss) --- Gnss_MbPool越界,刚好就冲到gnss_thread变量里了,然后打印出来的线程名都成乱码了。 太久没有RTT了,有点生疏了。。。
撰写答案
登录
注册新账号
关注者
0
被浏览
2.6k
关于作者
SimonLeung
这家伙很懒,什么也没写!
提问
12
回答
31
被采纳
0
关注TA
发私信
相关问题
1
请教cpu使用率分析
2
选择FreeRTOS, 还是RT-Thread。
3
thread heap stack overflow ?
4
rtt消息队列delay问题
5
释放被删除线程的内存地方在哪里啊
6
请教:各线程结束后,释放其中的内存的连续性问题
7
STM32F103中断关于信号量、邮箱问题
8
RTT中的线程栈大小如何控制
9
关于线程由执行态变为挂起态的代码实现,,,
10
rt_malloc(rt_size_t size)内存分配函数最小分配尺寸问题
推荐文章
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
【NXP-MCXA153】 定时器驱动移植
2
GD32F450 看门狗驱动适配
3
【NXP-MCXA153】看门狗驱动移植
4
RT-Thread Studio V2.2.9 Release Note
5
CherryUSB的bootuf2配置
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
freemodbus
flash
cubemx
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
rt_mq_消息队列_msg_queue
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
踩姑娘的小蘑菇
7
个答案
2
次被采纳
a1012112796
15
个答案
1
次被采纳
Ryan_CW
5
个答案
1
次被采纳
红枫
4
个答案
1
次被采纳
张世争
4
个答案
1
次被采纳
本月文章贡献
YZRD
3
篇文章
6
次点赞
catcatbing
3
篇文章
6
次点赞
lizimu
2
篇文章
8
次点赞
qq1078249029
2
篇文章
2
次点赞
xnosky
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部