A segmentation fault occurs when the application calls tslib

Publisher:和谐共存Latest update time:2024-09-20 Source: cnblogsKeywords:Application Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Problem description:


I transplanted the tslib test program ts_test.c touch screen operation program into my application program, and found that a segmentation fault occurred when the program ran to the ts_config function. The ts_test program can run on the development board, but why does my program have a segmentation fault?


1 ts = ts_open (tsdevice, 0);

2

3 if (!ts) {

4 perror (tsdevice);

5 exit(1);

6 }

7

8 if (ts_config(ts)) {

9 perror("ts_config");

10 exit(1);

11 }


Solution:


After cross-compiling tslib, some library files and header files will be generated. Copy all the generated library files and header files to the corresponding library file and header file directory of arm-linux-gcc, then re-cross-compile the program and copy it to the development board for running.


Cross compiler header file directory: arm-linux-gcc/4.5.1/arm-none-linux-gnueabi/sys-root/usr/include


Cross compiler library file directory: arm-linux--gcc/4.5.1/arm-none-linux-gnueabi/sys-root/usr/lib


For tslib transplantation, please refer to: http://www.cnblogs.com/ape-ming/p/5134542.html


Reference link: http://www.100ask.org/bbs/forum.php?mod=viewthread&tid=11267


Keywords:Application Reference address:A segmentation fault occurs when the application calls tslib

Previous article:Using Libpng library to display PNG images on Tiny6410
Next article:Linux-2.6.39 porting on Tiny6410 - Peripheral driver porting

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号