PDA

View Full Version : Fedora 8 kernel - native BB support for 8320, etc.


rivviepop
11-13-2007, 12:30 AM
Upgraded my laptop from F7 to F8 over the weekend, lo and behold my 8320 just plugs in, charges and works fine - no actual real work needed. It even resets the device to put it into the mode the barry tools will be looking for - here's the lsusb -v:


Bus 003 Device 003: ID 0fca:0004 Research In Motion, Ltd.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 16
idVendor 0x0fca Research In Motion, Ltd.
idProduct 0x0004
bcdDevice 1.06
iManufacturer 1 Research In Motion
iProduct 5 RIM Composite Device
iSerial 3 XXXXXXXXXXXXXXXXXXXXXXXXXXXX
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 97
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 8
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 1
bInterfaceProtocol 255
iInterface 2 BlackBerry
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x06 EP 6 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x08 EP 8 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 4 RIM Mass Storage Device
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x89 EP 9 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x0a EP 10 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0


I haven't gotten around to barry yet, but dang - I love the out of the box 'it just works' support we've got going on. :)

*&))
11-16-2007, 10:36 PM
I have an 8830 and just upgrade to Fedora 8 and did not have the same results. I get the usual unable to charge message. "USB charging current is not sufficient. Verify that your handheld is connected to a powered USB charging source and that the proper USB driver is installed."

rivviepop
11-16-2007, 11:36 PM
I have an 8830 and just upgrade to Fedora 8 and did not have the same results. I get the usual unable to charge message. "USB charging current is not sufficient. Verify that your handheld is connected to a powered USB charging source and that the proper USB driver is installed."

Maybe (maybe) because the device ID is not recognized by the "berry_charge" kernel module, so you should submit a bug report (if there isn't one already) and Greg the maintainer will add it. Plug in your device and run (as root) 'lsusb -v >lsusb_output.txt" then take a look at that text file. What does the line "idProduct" say under the appropriate "Research in Motion" device entry?

For a Pearl and Curve that value is 0x0006 and for 8700 and older it's 0x0001; these are (to my knowledge) the only two idProducts the driver knows about. Is the 8830 a 0x0006 device?

Also, are you plugging into a hub or directly into the computer? If you're plugging intoa hub, try a direct connect to the PC as a test.

rivviepop
11-16-2007, 11:39 PM
I didn't find any 8830 specific bugs in the bugbase, however you may wish to read this:

https://bugzilla.redhat.com/show_bug.cgi?id=379341

LunkHead
11-18-2007, 12:56 PM
I am really liking openSuse 10.3 but cant resist giving FC8 a spin... DL'in the ISO as we speak... Should be done when I get off work, then gonna fire the bad boy up!!!

I love new distro releases :)

:woot: :woot:

How do you like rivvie....?

rivviepop
11-18-2007, 01:29 PM
How do you like rivvie....?

Not bad! Of course there are some initial dot-oh release headaches here and there that need to get ironed out, but I like the underpinnings. The new font system that ditches XFS completely is really nice, it's controlled now by a more traditional "SysV-like" method with an /etc/fonts/conf.d/ and /etc/X11/fontpath.d/ that is easier to tweak and grasp. I use a lot of fonts, it's really helping.

I don't care for the default theme, it lags a little - I created a minor custom hybrid version of it that uses the Clearlooks window decorations on top of the Nadoka theme (new default) and it's much better. I also replace the default fonts with the "Luxi" versions +1 point (so "Sans 10" becomes "Luxi Sans 11") for much enhanced readability on LCD screens.

Now that I've gotten things ironed out (I never upgrade, always wipe & install using an external USB drive to hold my home directory temporarily) I think it's a keeper.

LunkHead
11-18-2007, 03:52 PM
Burning the ISO now and will be installing soon... I never upgrade anything either but then again, I change distro's almost as often as my underwear...

LunkHead
11-19-2007, 09:06 AM
Wirelessly posted (BlackBerry 8320: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BlackBerry8320/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100)

Very impressed with FC8! Nice distro..

Had massive issues getting the DVD ISO to boot, it kept freezing up after grub.. Downloaded the GNOME live CD and it booted right up and installed with no further issues..

Spent a few hours downloading apps and setting everything up...

Will try hooking the BB up and see how it acts later tonight..

Overall, its a sweet distro and I plan on keeping it over openSuse...

Kris

rivviepop
11-19-2007, 01:26 PM
Had massive issues getting the DVD ISO to boot, it kept freezing up after grub.. Downloaded the GNOME live CD and it booted right up and installed with no further issues..

Same here! I used some combination of "noacpi acpi=off" type stuff on the boot commandline before it finally worked, and after install it didn't have any problems. I only experienced this boot issue on a Dell laptop (and others are as well), on my Thinkpad the install DVD booted right up and ran like a champ.

I haven't run into something like that in a long time, it's weird it made it past QA. Some of the people reporting the problem mentioned that it didn't happen in the 'Test' releases, so it looks like something done right before release. :-/

LunkHead
11-19-2007, 05:24 PM
Update:

Plugged the BB into FC8 and..... Walla! It's a charging away!!!! SWEET!

LunkHead
12-06-2007, 09:59 PM
Update:

Working like a champ in Linux Mint as well!! :)

Kris

*&))
12-08-2007, 03:50 AM
Update:

Working like a champ in Linux Mint as well!! :)

Kris

I have made the switch to Mint from Ubuntu and i must say I love it so thus far. Everything works, is a very sold performer and the community is great in two ways, you have a great mint community as well as being able to fall back on the Ubuntu community as well.

LunkHead
12-08-2007, 11:31 AM
Mint is a very, very nice distro!

I am running E17 on top of it and it's works very nice as well... All the Mint extras are working well in E17...

Kris

LunkHead
12-10-2007, 08:36 PM
Not that it would not BUT... Working like a CHAMP on E17 (Mint / Ubuntu 7.10) under the hood as well!!

Kris

rivviepop
12-10-2007, 08:47 PM
Not that it would not BUT... Working like a CHAMP on E17 (Mint / Ubuntu 7.10) under the hood as well!!

What's your uname -a output on that there Mint rig?

LunkHead
12-10-2007, 08:54 PM
Ahhhhh....

Well now.... After double checking your request I see that if I log into gnome Mint 4.0 that it an a-ok with charging the BB...

However, if I am running the E17 it's a NO GO....

My bad.... Open mouth and insert my foot... I booted gnome and noticed I was a charging away... Saw your post and DUH....

I am NOT the brightest bulb in the pack! :)

You want me to post my Mint uname -a output???


Here is my E17:


2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux

Kris

LunkHead
12-10-2007, 09:18 PM
I wonder if I ran the standard Mint kernel with E17 on top (not compile the generic) if the BB would charge on E17 ...

Hummmm...... I have a mission for my days off....

Kris

rivviepop
12-10-2007, 09:24 PM
Yeah you need 2.6.23+ kernel which has the latest berry_charge kernel module. E17 is just a window manager ("just" - hah) so I don't see any reason it couldn't run on top of Mint. Once you got all the bits installed into Mint you'd just have to start E17 instead of GNOME (I am not familiar with Ubuntu's take on "startx" but I'm sure it's similar to Fedora). I vaguely remember messing with E.... E14? a very, very (very) long time ago. That's about as close as I come to knowing much about it. :)

Another thought for E17: grab the latest berry_charge.c source code file from the kernel version control (or an official release tarball) and try hand compiling it, then hand copying it overtop the old one. I bet that might work, it sounds reasonable...

LunkHead
12-10-2007, 09:29 PM
Yes I see your point... I will give it a try this weekend... I am running E17 (generic kernel) on a separate partition than Mint...

I will try the install E17 over the Mint kernel and see what I get... If not I will compile berry and see what I get wih the generic kernel...

I will post back with my results...

Kris

LunkHead
12-10-2007, 11:28 PM
I vaguely remember messing with E.... E14? a very, very (very) long time ago. That's about as close as I come to knowing much about it.

Never used E14... Tried E15 and E16 and am now sporting E17...

Amazingly enough E17 is STILL considered an alpha development...

Was that way on E15....

BUT..... Even though it is considered an alpha it's amazingly very, very stable... I have had a few burps, errors, and FUBR's but it's really pretty solid for still being in alpha state....

I will play with the kernel on my days off (Fri, sat, sun) and let ya know how it worked out....

I am thinking I will try generic kernel 1st with barry and if that no work or I get tired of compiling, then I will try the Mint kernel with E17 plastered over the top....

Kris

Theodor
12-22-2007, 11:17 AM
Just got a 8320 and am running Fedora 8. I get the "current is not sufficient..." error.

looking a the output from lsusb -v I see differences in mine and the origanial poster.

mine :idProduct 0x0006
OP: idProduct 0x0004
then i see this in the third post

"For a Pearl and Curve that value is 0x0006 and for 8700 and older it's 0x0001; these are (to my knowledge) the only two idProducts the driver knows about. Is the 8830 a 0x0006 device?"

We might want to add 0x0004 =), so three now

mine: iProduct 4 RIM Mass Storage Device
OP: iProduct 5 RIM Composite Device

and

mine: MaxPower 100mA
OP: MaxPower 500mA

Power seems to be my issue, not sure how to fix it yet, but I am interested to know why the idProduct and iProduct are not the same for myself and the OP given we have the same device and carrier.

rivviepop
12-22-2007, 12:36 PM
looking a the output from lsusb -v I see differences in mine and the origanial poster.

mine :idProduct 0x0006
OP: idProduct 0x0004
then i see this in the third post


OK 4 means it's been "triggered" (unlocked? opened?) from the default 6, so *something* is happening. Let me ask if you've verified these:

- you're running the 2.6.23.X kernel (2.6.23.8-63.fc8 e.g.)
- you do not have any barry or bcharge bits installed
- you are plugging directly into your PC and not an external USB hub

The first item has to do with having a new enough berry_charge.ko kernel module, earlier versions did *not* support the 81/83/88xx devices yet. The second is because the bcharge from barry conflicts with the kernel module berry_charge. The last is because there's some sort of bug (there's a ticket in Bugzilla) with using an external USB hub that hasn't been fixed yet.

Theodor
12-22-2007, 02:34 PM
Linux black10 2.6.23.9-85.fc8 #1 SMP Fri Dec 7 15:49:59 EST 2007 i686 i686 i386 GNU/Linux

If barry or bcharge are packages, neither are installed.

I have 6 USB ports on the machine, two on the front panel and 4 in the back.

I've tired all of them with the same results. the full output of lsusb -v shows all USB connected devices are MaxPower 100mA. I have a keyboard and mouse connected USB.

rivviepop
12-22-2007, 03:01 PM
Hmm. Here's what happens on my Thinkpad (T43, 2 USB ports only) after a fresh reboot and then plugging in the device (I just updated to the same kernel as you):

/var/log/messages

Dec 22 11:48:09 ender kernel: usb 3-2: new full speed USB device using uhci_hcd and address 2
Dec 22 11:48:09 ender kernel: usb 3-2: configuration #1 chosen from 1 choice
Dec 22 11:48:09 ender kernel: usbcore: registered new interface driver berry_charge
Dec 22 11:48:10 ender kernel: Initializing USB Mass Storage driver...
Dec 22 11:48:10 ender kernel: usb 3-2: USB disconnect, address 2
Dec 22 11:48:10 ender kernel: usbcore: registered new interface driver usb-storage
Dec 22 11:48:10 ender kernel: USB Mass Storage support registered.
Dec 22 11:48:10 ender kernel: usb 3-2: new full speed USB device using uhci_hcd and address 3
Dec 22 11:48:11 ender kernel: usb 3-2: configuration #1 chosen from 1 choice
Dec 22 11:48:11 ender kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Dec 22 11:48:11 ender kernel: usb 3-2: USB disconnect, address 3
Dec 22 11:48:11 ender kernel: usb 3-2: new full speed USB device using uhci_hcd and address 4
Dec 22 11:48:11 ender kernel: usb 3-2: configuration #1 chosen from 1 choice
Dec 22 11:48:12 ender kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Dec 22 11:48:17 ender kernel: scsi 3:0:0:0: Direct-Access RIM BlackBerry SD 0001 PQ: 0 ANSI: 4 CCS
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] 3970048 512-byte hardware sectors (2033 MB)
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Write Protect is off
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Assuming drive cache: write through
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] 3970048 512-byte hardware sectors (2033 MB)
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Write Protect is off
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Assuming drive cache: write through
Dec 22 11:48:17 ender kernel: sdb:
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Attached SCSI removable disk
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: Attached scsi generic sg2 type 0
Dec 22 11:48:17 ender gnome-keyring-daemon[2197]: adding removable location: volume_uuid_A0A7_9311 at /media/disk
Dec 22 11:48:17 ender gnome-keyring-daemon[2874]: adding removable location: volume_uuid_A0A7_9311 at /media/disk
Dec 22 11:48:17 ender hald: mounted /dev/sdb on behalf of uid 500


I get nothing in my dmesg, this is the only debugging output I see (without loading modules with debug switches and all that jazz). You see the third line there where it registers the berry_charge module, then the USB Mass Storage line, then the 5th line is the "disconnect" message? That's berry_charge resetting the port to expose the 0x0004 endpoint and increase the charging to 500mA.

Do you see the same pattern on your machine? What differences are there? You can also try using the debug mode of berry_charge; make sure the module is unloaded (rmmod berry_charge) then add to /etc/modprobe.conf the line:


options berry_charge debug=1


You may or may not need to reboot to activate this, I've had mixed results with various modules, some work fine without a reboot but some don't - I'd say reboot just to be safe that you know it's active/working.

There is also another parameter that I see (I ran 'strings' on the module) for "pearl_dual_mode" - setting this may or may not provide some more debugging output, it's a boolean as well. (options berry_charge debug=1 pearl_dual_mode=1)

The strings output:

# strings /lib/modules/2.6.23.9-85.fc8/kernel/drivers/usb/misc/berry_charge.ko
UWVS
[^_]
<7>%s %s: Power is set to %dmA
<7>%s %s: device is already charging, power is set to %dmA
<7>%s %s: Sending first magic command
<3>%s %s: First magic command failed: %d.
<7>%s %s: Sending second magic command
<3>%s %s: Second magic command failed: %d.
<7>%s %s: Calling set_configuration
<3>%s %s: Set Configuration failed :%d.
<7>%s %s: Sending magic pearl command
<7>%s %s: Magic pearl command returned %d
berry_charge
parm=pearl_dual_mode:Change Blackberry Pearl to run in dual mode
parmtype=pearl_dual_mode:bool
parm=debug:Debug enabled or not
parmtype=debug:bool
author=Greg Kroah-Hartman <gregkh@<hidden>>
license=GPL
alias=usb:v0FCAp0004d*dc*dsc*dp*ic*isc*ip*
alias=usb:v0FCAp0006d*dc*dsc*dp*ic*isc*ip*
alias=usb:v0FCAp0001d*dc*dsc*dp*ic*isc*ip*
depends=
vermagic=2.6.23.9-85.fc8 SMP mod_unload 686 4KSTACKS
pearl_dual_mode
debug
berry_charge

Theodor
12-23-2007, 08:28 PM
Thanks for you help on this =)

I get this in messages


Dec 23 20:16:40 black10 kernel: usb 2-2: new full speed USB device using ohci_hcd and address 6
Dec 23 20:16:40 black10 kernel: usb 2-2: configuration #1 chosen from 1 choice
Dec 23 20:16:40 black10 kernel: scsi10 : SCSI emulation for USB Mass Storage devices
Dec 23 20:16:45 black10 kernel: scsi 10:0:0:0: Direct-Access RIM BlackBerry SD 0001 PQ: 0 ANSI: 4 CCS
Dec 23 20:16:45 black10 kernel: sd 10:0:0:0: [sdb] Attached SCSI removable disk
Dec 23 20:16:45 black10 kernel: sd 10:0:0:0: Attached scsi generic sg2 type 0
Dec 23 20:21:52 black10 kernel: usb 2-2: USB disconnect, address 6
Dec 23 20:22:06 black10 kernel: usb 2-2: new full speed USB device using ohci_hcd and address 7
Dec 23 20:22:06 black10 kernel: usb 2-2: configuration #1 chosen from 1 choice
Dec 23 20:22:06 black10 kernel: scsi11 : SCSI emulation for USB Mass Storage devices
Dec 23 20:22:11 black10 kernel: scsi 11:0:0:0: Direct-Access RIM BlackBerry SD 0001 PQ: 0 ANSI: 4 CCS
Dec 23 20:22:11 black10 kernel: sd 11:0:0:0: [sdb] Attached SCSI removable disk
Dec 23 20:22:11 black10 kernel: sd 11:0:0:0: Attached scsi generic sg2 type 0


Setting the debug gave no further information.

The first thing i see right away is
mine: usb 2-2
yours: usb 3-2

Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] 3970048 512-byte hardware sectors (2033 MB)
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Write Protect is off
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Assuming drive cache: write through
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] 3970048 512-byte hardware sectors (2033 MB)
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Write Protect is off
Dec 22 11:48:17 ender kernel: sd 3:0:0:0: [sdb] Assuming drive cache: write through
Dec 22 11:48:17 ender kernel: sdb:

I am guessing this is your miniSD

rivviepop
12-23-2007, 08:55 PM
Yeah, that 3-2, 2-2 stuff is simply the ID of the specific USB port in question, which bus and all that stuff. Unless we're using the exact same laptop/desktop it'll probably be different.

So in your dmesg output I notice that the messages for the initialization of usbcore, usb_storage and berry_charge are conspicuously missing, it's as if the modules are already loaded or not loading at all. Mainly the most important one is berry_charge, it's as if it's not even loading; if you to a 'lsmod | grep berry" to you see/have/get the module loaded?

If the above answer is no, what happens if you run this command:

modprobe berry_charge debug=1

Does the module load if you manually run that command?

Theodor
12-24-2007, 07:00 AM
This feels like "Doh!" moment. The module is there but wasn't loading by default.

Thanks for your help riv

rivviepop
12-24-2007, 12:28 PM
This feels like "Doh!" moment. The module is there but wasn't loading by default.

Thanks for your help riv

doh! if it's not automagically loading then I suspect a bug somewhere (like maybe udev isn't seeing the device? a guess only), if you feel like debugging it. At least it works when you manually load it which is half the battle - your not loading problem might be related to the bug where it crashes udev on the PC and reboots the BB when you plug it into an external hub.

It might be time to start searching the Bugzilla for Fedora...

Theodor
12-28-2007, 12:42 AM
Had to correct this.

After more trial and error I found my issue to be a user error. The smart card reader daemon wasn't enabled.