notro / fbtft

Linux Framebuffer drivers for small TFT LCD display modules. Development has moved to https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing
1.86k stars 495 forks source link

Can't do easy fbtft development with notro/rpi-firmware #38

Closed notro closed 10 years ago

notro commented 11 years ago

With the FBTFT image it's easy to do FBTFT driver development: https://github.com/notro/fbtft/wiki/Development

When I try this with the rpi-update release, I end up with: Unable to handle kernel NULL pointer dereference at virtual address 00000004

I follow the guide except that I skip making a new driver, just rebuilding. This is used to copy .config and Module.symvers

sudo cp /root/.rpi-firmware/extra/{.config,Module.symvers} /tmp && cp -v /tmp/{.config,Module.symvers} ~/linux

First I try loading a driver from the build directory, but using the installed fbtft module:

$ sudo modprobe fbtft
$ sudo insmod ~/linux/drivers/video/fbtft/fb_ili9320.ko
Error: could not insert module /home/pi/linux/drivers/video/fbtft/fb_ili9320.ko: Invalid parameters
$ dmesg
[  945.766702] fb_hello: disagrees about version of symbol fbtft_remove_common
[  945.777462] fb_hello: Unknown symbol fbtft_remove_common (err -22)
[  945.786167] fb_hello: disagrees about version of symbol fbtft_probe_common
[  945.795441] fb_hello: Unknown symbol fbtft_probe_common (err -22)
[ 1888.454673] fb_ili9320: disagrees about version of symbol fbtft_remove_common
[ 1888.463425] fb_ili9320: Unknown symbol fbtft_remove_common (err -22)
[ 1888.472668] fb_ili9320: disagrees about version of symbol fbtft_probe_common
[ 1888.482336] fb_ili9320: Unknown symbol fbtft_probe_common (err -22)

Then I install all the fbtft modules

$ sudo cp -v /lib/modules/$(uname -r)/build/drivers/video/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/video/fbtft/
`/lib/modules/3.6.11+/build/drivers/video/fbtft/ads7846_device.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/ads7846_device.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_hx8340bn.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_hx8340bn.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_hx8347d.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_hx8347d.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_ili9320.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_ili9320.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_ili9325.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_ili9325.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_ili9341.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_ili9341.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_pcd8544.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_pcd8544.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_ssd1289.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_ssd1289.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_ssd1351.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_ssd1351.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fb_st7735r.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fb_st7735r.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fbtft_device.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fbtft_device.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/fbtft.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/fbtft.ko'
`/lib/modules/3.6.11+/build/drivers/video/fbtft/flexfb.ko' -> `/lib/modules/3.6.11+/kernel/drivers/video/fbtft/flexfb.ko'
$ sudo depmod

Reload the new fbtft

$ sudo modprobe -r fbtft
$ sudo modprobe fbtft

Load a driver

$ sudo modprobe fb_ili9320

Now the computer hangs and this shows up on the console

[ 1992.464662] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[ 1992.476398] pgd = d9ef8000
[ 1992.480907] [00000004] *pgd=00000000
[ 1992.486268] Internal error: Oops: 5 [#1] PREEMPT ARM

Entering kdb (current=0xd9e9a280, pid 7955) Oops: (null)
due to oops @ 0xc005d2b8

Pid: 7955, comm:             modprobe
CPU: 0    Tainted: G           O  (3.6.11+ #1)
PC is at module_put+0x28/0x6c
LR is at sys_init_module+0x428/0x19bc
pc : [<c005d2b8>]    lr : [<c005e500>]    psr: a0000013
sp : d9f61ef0  ip : 00000000  fp : 00000324
r10: 00000024  r9 : bf0f6d9c  r8 : 0000001c
r7 : 00000001  r6 : d9f2e720  r5 : bf0f6d54  r4 : d9f60000
r3 : 00000000  r2 : 00000000  r1 : 00000001  r0 : bf0f6d54
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 00c5387d  Table: 19ef8008  DAC: 00000015
[<c0013c64>] (unwind_backtrace+0x0/0xf0) from [<c00732b8>] (kdb_dumpregs+0x28/0x50)
[<c00732b8>] (kdb_dumpregs+0x28/0x50) from [<c007563c>] (kdb_main_loop+0x3a8/0x6fc)
[<c007563c>] (kdb_main_loop+0x3a8/0x6fc) from [<c0077d20>] (kdb_stub+0x154/0x380)
[<c0077d20>] (kdb_stub+0x154/0x380) from [<c006ee5c>] (kgdb_handle_exception+0x1f8/0x668)
[<c006ee5c>] (kgdb_handle_exception+0x1f8/0x668) from [<c00133e4>] (kgdb_notify+0x24/0x40)
[<c00133e4>] (kgdb_notify+0x24/0x40) from [<c039fdb4>] (notifier_call_chain+0x44/0x84)
[<c039fdb4>] (notifier_call_chain+0x44/0x84) from [<c039fe2c>] (__atomic_notifier_call_chain+0x38/0x4c)
[<c039fe2c>] (__atomic_notifier_call_chain+0x38/0x4c) from [<c039fe58>] (atomic_notifier_call_chain+0x18/0x20)
[<c039fe58>] (atomic_notifier_call_chain+0x18/0x20) from [<c039fe98>] (notify_die+0x38/0x44)
[<c039fe98>] (notify_die+0x38/0x44) from [<c0011138>] (die+0xc4/0x39c)
[<c0011138>] (die+0xc4/0x39c) from [<c0398bf8>] (__do_kernel_fault.part.9+0x54/0x74)
[<c0398bf8>] (__do_kernel_fault.part.9+0x54/0x74) from [<c039fad4>] (do_page_fault+0x1d8/0x3cc)
[<c039fad4>] (do_page_fault+0x1d8/0x3cc) from [<c000832c>] (do_DataAbort+0x34/0x98)
[<c000832c>] (do_DataAbort+0x34/0x98) from [<c039e2d8>] (__dabt_svc+0x38/0x60)
Exception stack(0xd9f61ea8 to 0xd9f61ef0)
1ea0:                   bf0f6d54 00000001 00000000 00000000 d9f60000 bf0f6d54
1ec0: d9f2e720 00000001 0000001c bf0f6d9c 00000024 00000324 00000000 d9f61ef0
1ee0: c005e500 c005d2b8 a0000013 ffffffff
[<c039e2d8>] (__dabt_svc+0x38/0x60) from [<c005d2b8>] (module_put+0x28/0x6c)
[<c005d2b8>] (module_put+0x28/0x6c) from [<c005e500>] (sys_init_module+0x428/0x19bc)
[<c005e500>] (sys_init_module+0x428/0x19bc) from [<c000db60>] (ret_fast_syscall+0x0/0x30)
more>
kdb>

I have no idea what goes wrong here.

armonico commented 11 years ago

dear notro. Do you have any progress for this issue? I have same problem....

notro commented 11 years ago

I haven't looked more into this. A work around is to use the downloadable image instead: https://github.com/notro/fbtft/wiki#image-downloads

This might be a related issue: https://github.com/raspberrypi/linux/issues/387

notro commented 10 years ago

Updating gcc resolves this.

$ cat /proc/version
Linux version 3.10.32+ (pi@raspi2) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #2 PREEMPT Fri Mar 7 01:33:27 CET 2014

$ gcc --version | grep gcc
gcc (Debian 4.7.2-5+rpi1) 4.7.2

Details: https://github.com/notro/fbtft-spindle/wiki/Building-kernel-modules