GUI

[已解决]创建GUI显示线程,出现bus fault错误应该怎么解?

发布于 2014-12-11 23:33:44
自己创建了一个GUI显示线程:
tid = rt_thread_create("mgui",showgui, RT_NULL,2048 * 2, 25, 10);

在showgui函数中执行创建和显示GUI过程:
struct rtgui_app *app;
struct rtgui_rect rect;
app = rtgui_app_create("guiapp");
if (app == RT_NULL)
return;

/* create a full screen window */
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect);

main_win = rtgui_win_create(RT_NULL, "mainwin", &rect,
RTGUI_WIN_STYLE_NO_BORDER | RTGUI_WIN_STYLE_NO_TITLE);
if (main_win == RT_NULL)
{
rtgui_app_destroy(app);
return;
}


/* create a no title notebook that we can switch demo on it easily. */
main_notebook = rtgui_notebook_create(&rect, RTGUI_NOTEBOOK_NOTAB);
if (main_notebook == RT_NULL)
{
rtgui_win_destroy(main_win);
rtgui_app_destroy(app);
return;
}

rtgui_container_add_child(RTGUI_CONTAINER(main_win), RTGUI_WIDGET(main_notebook));
/* 初始化各个例子的视图 */
main_view_window(main_notebook);
rtgui_win_show(main_win, RT_FALSE);

/* 执行工作台事件循环 */
rtgui_app_run(app);

rtgui_app_destroy(app);

但是rtguiwidgetswindow.c文件中的rtgui_win_show函数在调用rtgui_widget_show(RTGUI_WIDGET(win))时,在
if (RTGUI_OBJECT(widget)->event_handler != RT_NULL)
{
RTGUI_OBJECT(widget)->event_handler(
RTGUI_OBJECT(widget),
&eshow);
}

RTGUI_OBJECT(widget)->event_handler处理得到如下错误:
finsh>>TCP/IP initialized!
psr: 0x21000000
r00: 0x20007038
r01: 0x10000000
r02: 0xf0000000
r03: 0x00000020
r04: 0x0800389d
r05: 0x080b0080
r06: 0x080b0dc3
r07: 0x00000233
r08: 0x08034931
r09: 0x2000adc8
r10: 0xdeadbeef
r11: 0xdeadbeef
r12: 0x080033f1
lr: 0x0800f02f
pc: 0x0800f02e
hard fault on thread: mgui

thread pri status sp stack size max used left tick error
-------- ---- ------- ---------- ---------- ---------- ---------- ---
tcpip 0x0c suspend 0x000000dc 0x00000400 0x000000dc 0x00000014 000
mgui 0x19 ready 0x00000140 0x00001000 0x000001d8 0x0000000a 000
tp 0x10 suspend 0x00000090 0x00000400 0x000000c0 0x00000014 000
rtgui 0x0f suspend 0x000000f0 0x00000400 0x000000f0 0x00000005 000
tidle 0x1f ready 0x00000044 0x00000100 0x00000044 0x00000016 000
tshell 0x14 suspend 0x00000094 0x00000800 0x00000094 0x0000000a 000
init 0x0a close 0x00000068 0x00000800 0x00000128 0x00000012 000
bus fault:
SCB_CFSR_BFSR:0x82 PRECISERR SCB->BFAR:C012A169

请问这个问题是什么原因,应该怎么解决?

查看更多

关注者
0
被浏览
1.4k
3 个回答
bernard
bernard 2014-12-11
是不是没内存了?
whtiea
whtiea 2014-12-28
不是没内存了,是自己把控件用错了

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友