2009-07-15 10:54:03 Microwindows on BF-537EZKIT with LCD-EZ Extender
Hugh Lewis (UNITED KINGDOM)
Message: 77382
I have been struggling for some time with trying to get the AD7897 touchscreen controller on the LCD EZ extender to function with Microwindows.
I have got the screen to calibrate with ts_calibrate and I have nano-X run the demo nxclock and nxkbd. When I run ts_calibrate prior to nano-X I get a crash.
Any suggestions as to what I might be doing wrong?
root:/> env
TERM=linux
PATH=/bin:/usr/bin:/sbin:/usr/sbin
HUSH_VERSION=1.14.2
TSLIB_FBDEVICE=/dev/fb0
TSLIB_CONSOLEDEVICE=none
TSLIB_CONFFILE=/etc/ts.conf
TSLIB_CALIBFILE=/etc/pointercl
TSLIB_TSDEVICE=/dev/input/event0
CONSOLE=tty3
root:/> ts_calibrate
xres = 320, yres = 240
Took 28 samples...
Top left : X = 3147 Y = 3443
Took 35 samples...
Top right : X = 3178 Y = 687
Took 46 samples...
Bot right : X = 894 Y = 694
Took 49 samples...
Bot left : X = 886 Y = 3456
Took 37 samples...
Center : X = 2084 Y = 2091
326.074493 -0.000335 -0.079738
246.362030 -0.061575 -0.000427
Calibration constants: 21369618 -21 -5225 16145582 -4035 -27 65536
root:/> cd etc
root:/etc> ls
TZ group ld.so.cache pointercl ts.conf
boa host.conf mdev.conf profile tux-bf.gif
boa.conf hosts mime.types protocols version
config inetd.conf modprobe.conf ramfs.img
dhcpc inittab motd rc
filesystems issue passwd services
root:/etc> cd ..
root:/> nano-X &
[1] 44 nano-X
root:/> ------------[ cut here ]------------
kernel BUG at mm/nommu.c:531!
Kernel panic - not syncing: BUG()
Hardware Trace:
0 Target : <0x00004aac> /* kernel dynamic memory */
Source : <0xffa00672> /* kernel dynamic memory */ CALL pcrel
QuoteReplyEditDelete
2009-07-15 11:02:16 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Mike Frysinger (UNITED STATES)
Message: 77383
looks like a bug in trunk that we'll have to investigate and fix. all i can suggest at this point is to try the 2009R1 branch as this appears to be a bug in nommu code that is new to 2.6.30.
QuoteReplyEditDelete
2009-07-15 11:02:59 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Mike Frysinger (UNITED STATES)
Message: 77384
can you run `make bugreport` and post the tarball as an attachment ? it'll help in case we are unable to reproduce the problem right away ...
QuoteReplyEditDelete
2009-07-15 11:20:02 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Hugh Lewis (UNITED KINGDOM)
Message: 77385
Hi Mike,
I am new to this, so I hope I have done the correct things.
Hugh
bugreport.tar.gz
QuoteReplyEditDelete
2009-07-15 23:43:52 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Yi Li (CHINA)
Message: 77415
Add it in the bug tracker: blackfin.uclinux.org/gf/tracker/5360
QuoteReplyEditDelete
2009-07-16 11:57:03 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Hugh Lewis (UNITED KINGDOM)
Message: 77463
Hi Mike,
Having spent the last day setting up to use 2009R1 in a hope that it would get round the crash, I am now unable to get Mircowindows to build. It seems like I have some wrong setting in the make file. Can you give me any pointers as to where I should look.
make[6]: Entering directory `/home/hugh/2009R1/user/microwin/src/drivers'
Compiling drivers/obsolete.c ...
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
/home/hugh/2009R1/user/microwin/src/drivers/obsolete.c:1: error: bad value (bf537-0.2) for -mtune= switch
make[6]: *** [/home/hugh/2009R1/user/microwin/src/obj/drivers/obsolete.o] Error 1
Much appreciated.
Hugh
QuoteReplyEditDelete
2009-07-16 14:09:48 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Mike Frysinger (UNITED STATES)
Message: 77471
try applying this patch:
blackfin.uclinux.org/gf/project/uclinux-dist/scmsvn/trunk/user/microwin/?action=browse&view=rev&revision=8340
that should be the only difference between the 2009R1 branch and trunk
QuoteReplyEditDelete
2009-07-16 14:59:44 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Hugh Lewis (UNITED KINGDOM)
Message: 77480
Thanks Mike,
Not sure how to do the patching correctly but I solved it by copying the three files you highlighted from my trunk copy to my 2009R1 copy. I now have Microwin built and working.
Hugh
QuoteReplyEditDelete
2009-07-23 18:12:51 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Andreas Pretzsch (GERMANY)
Message: 77978
Same happens here, trigger seems to be mmap.
I'm writing a driver for a TFT based on drivers/video/bfin-lq035q1-fb.c. Essentially the same code, different PPI parameters Works fine so far, beside the crash/lockup.
Case 1: Panic (see attachment) when being called 3 times in a row, sequence open/mmap/munmap/close.
Case 2: MAP_FAILED resp. EPERM in case of open/3*[mmap,munmap].
Trigger code is attached. Call it without parameters for case 1 and with e.g. 3 for case 2. Number of iterations might differ depending on setup.
Same issue happens with user/blkfin-test/video_test.
Kernel: Linux 2.6.30.1-ADI-2010R1-pre-svn6972 on a BF561.
Right now I'm missing the time to dig deeper inside the issue, but I can test any patches. JTAG debugger (Lauterbach ICD) is available.
fb_mmap_crash.c
fb_mmap_panic.log
QuoteReplyEditDelete
2009-07-23 18:18:00 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Andreas Pretzsch (GERMANY)
Message: 77979
Files got lost, so I add them inline.
fb_mmap_panic.log:
Linux version 2.6.30.1-ADI-2010R1-pre-svn6972 @ BF561
kernel BUG at mm/nommu.c:531!
Kernel panic - not syncing: BUG()
Hardware Trace:
0 Target : <0x00004d6c> { _trap_c + 0x0 }
Source : <0xffa006ae> { _exception_to_level5 + 0x9a } CALL pcrel
1 Target : <0xffa00614> { _exception_to_level5 + 0x0 }
Source : <0xffa004d6> { _bfin_return_from_exception + 0x6 } RTX
2 Target : <0xffa004d0> { _bfin_return_from_exception + 0x0 }
Source : <0xffa00566> { _ex_trap_c + 0x6e } JUMP.S
3 Target : <0xffa004f8> { _ex_trap_c + 0x0 }
Source : <0xffa00754> { _trap + 0x38 } JUMP (P4)
4 Target : <0xffa0073a> { _trap + 0x1e }
Source : <0xffa00736> { _trap + 0x1a } IF !CC JUMP
5 Target : <0xffa0071c> { _trap + 0x0 }
Source : <0x00039e30> { _add_nommu_region + 0x54 } IF !CC JUMP
6 Target : <0x00039e2e> { _add_nommu_region + 0x52 }
Source : <0x00039e24> { _add_nommu_region + 0x48 } IF !CC JUMP
7 Target : <0x00039e22> { _add_nommu_region + 0x46 }
Source : <0x00039df8> { _add_nommu_region + 0x1c } IF CC JUMP
8 Target : <0x00039df2> { _add_nommu_region + 0x16 }
Source : <0x00039e04> { _add_nommu_region + 0x28 } IF CC JUMP
9 Target : <0x00039df2> { _add_nommu_region + 0x16 }
Source : <0x00039e04> { _add_nommu_region + 0x28 } IF CC JUMP
10 Target : <0x00039df2> { _add_nommu_region + 0x16 }
Source : <0x00039e04> { _add_nommu_region + 0x28 } IF CC JUMP
11 Target : <0x00039df2> { _add_nommu_region + 0x16 }
Source : <0x00039e04> { _add_nommu_region + 0x28 } IF CC JUMP
12 Target : <0x00039ddc> { _add_nommu_region + 0x0 }
Source : <0x0003ab96> { _do_mmap_pgoff + 0x1a2 } CALL pcrel
13 Target : <0x0003ab8e> { _do_mmap_pgoff + 0x19a }
Source : <0x0003a512> { _do_mmap_private + 0x1fe } RTS
14 Target : <0x0003a4fc> { _do_mmap_private + 0x1e8 }
Source : <0x0003a336> { _do_mmap_private + 0x22 } IF !CC JUMP
15 Target : <0x0003a332> { _do_mmap_private + 0x1e }
Source : <0x0009ecca> { _fb_mmap + 0x42 } RTS
fb_mmap_crash.c:
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <sys/mman.h>
#include <string.h>
int main(int argc, char *argv[])
{
int fd;
unsigned char *framebase;
struct fb_var_screeninfo vi;
int n = 1;
fd = open("/dev/fb0", O_RDWR);
if (fd < 0) {
perror("could not open /dev/fb0");
return 1;
}
ioctl(fd, FBIOGET_VSCREENINFO, &vi);
if (argc == 2) {
n = atoi(argv[1]);
}
while (n--) {
printf("%d\n", n);
framebase = mmap(0, vi.xres * vi.yres * 2, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
if (framebase == MAP_FAILED) {
close(fd);
perror("unable to mmap frame buffer");
return 1;
}
printf("fb=%p\n", framebase);
munmap(framebase, vi.xres * vi.yres * 2);
}
close(fd);
return 0;
}
QuoteReplyEditDelete
2009-09-25 00:46:46 Re: Microwindows on BF-537EZKIT with LCD-EZ Extender
Graf Yang (CHINA)
Message: 80412
In spite of the nommu.c bugs,
the implementation of lq035q1 fb driver not permit mmap then unmap more than 1 times.
So you can't run fb_mmap_crash with argument 2, 3, ...
But you can freely run it without argument.
I have check-in a patch to nommu.c, hope it fixes it's bug.