Author Topic: Stuffing Serial Bluetooth Module Inside C1k Casing  (Read 387433 times)

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #255 on: April 19, 2006, 07:24:11 pm »
http://www.iral.com/~albertr/linux/zaurus/wireless/

was updated with new software. Nothing radical, just minor clean-up,
-albertr

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #256 on: April 30, 2006, 05:16:29 pm »
Finally managed to build a kernel. Bit of an epic.

Googled and come up with lots of ways to do this but I am sure there is only one correct way.

How do I put this kernel on? (SL-C3000)

If my kernel is stuffed can I easily recover or might it brick the Zaurus?

Just looking for some reassurance

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #257 on: April 30, 2006, 05:58:48 pm »
You can flash the kernel the same way you flash the Cacko ROM. Put the updater.sh from Cacko ROM on empty card. Copy your recently built  zImage to this card and flash from it.
It could be a good idea to backup the content of your NAND chip first, just in case.
-albertr

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #258 on: May 01, 2006, 06:22:20 am »
OK, kernel loaded.

More handholding please

I have decided that this serial port is ttyS2 as ttyS1 seems to be IR and I assume ttyS0 is the wired serial port on the back.

If I type "hciattach /dev/ttyS2 csr 460800" then I get "Initialization timed out."
If I type "hciattach /dev/ttyS2 ericsson 460800" then I get my prompt back with no error messages.
Is this proving that the module is getting initialised OK? (it is an Ericsson module)

After this I type "hcid -f /etc/bluetooth/hcid.conf" then "sdpd" (I have no idea why)

Then "hcitool scan"

This gets me "Device is not available: Success"

Which isn't really what I was hoping for

Am I heading the right way, what next?

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #259 on: May 01, 2006, 06:33:11 am »
Quote
If I type "hciattach /dev/ttyS2 csr 460800" then I get "Initialization timed out."
If I type "hciattach /dev/ttyS2 ericsson 460800" then I get my prompt back with no error messages.
Is this proving that the module is getting initialised OK? (it is an Ericsson module)

[div align=\"right\"][a href=\"index.php?act=findpost&pid=125270\"][{POST_SNAPBACK}][/a][/div]

No it isn't as I get the same response from ttyS1 and I don't have two Ericsson modules loaded. So, how do I tell it's there?

With my scope attached to TX on the motherboard, after boot the line is at 0v

After
hciattach /dev/ttyS0 ericsson 460800
and
hciattach /dev/ttyS2 ericsson 460800
the TX line stays at 0v

after
hciattach /dev/ttyS1 ericsson 460800
the TX line goes to 3.3 volts but there is no burst of data into the BT module from the motherboard.

This suggests to me that the connections are ttyS1. It is also pretty apparent to me that ttyS1 is used for the infra red as "cat /proc/tty/driver/serial"

returns
serinfo:1.0 driver:5.05c revision:Apr 30 2006
0: uart:PXA UART port:F8100000 irq:22 baud:460800 tx:5 rx:0 RTS|CTS|DTR|DSR|CD|RI
1: uart:PXA UART port:F8200000 irq:21 baud:460800 tx:0 rx:0 RTS|DTR
2: uart:PXA UART port:F8700000 irq:20 baud:460800 tx:0 rx:0 RTS|DTR

after I have used the hciattach command but after using the infra red send or receive in the settings tab the entry for ttyS1 is changed.

So it appears that I have IR and BT on ttyS1
« Last Edit: May 01, 2006, 07:53:24 am by Mjolinor »

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #260 on: May 01, 2006, 07:52:45 am »
BTUART is /dev/ttyS1.

You can check the content of /proc/tty/driver/serial, it should give you idea if speed was set right and how many bytes were sent/received and if there's any parity/frame/overrun errors. If you see many frame/parity errors for ttyS1, when there might be something wrong with wiring. Also, you have to use hardware flow control for H4 uart protocol (check hciattach options to make sure).

-albertr

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #261 on: May 01, 2006, 07:55:03 am »
SiR is wired to STUART, which should be /dev/ttyS2.

-albertr
« Last Edit: May 01, 2006, 11:38:55 am by albertr »

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #262 on: May 01, 2006, 07:56:15 am »
So how do I get over the IR also being on ttyS1
This is copied from an SSH session

Quote
# hciattach /dev/ttyS1 ericsson 460800
# cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:Apr 30 2006
0: uart:PXA UART port:F8100000 irq:22 baud:460800 tx:5 rx:0 CTS|DSR|CD|RI
1: uart:PXA UART port:F8200000 irq:21 baud:460800 tx:0 rx:0 RTS|DTR
2: uart:PXA UART port:F8700000 irq:20 baud:460800 tx:0 rx:0

now, using the 10 hands that I have, I turn the Z over holdiong the battery in as ther eis no bottom on it  and click the IR receive icon in the settings tab and tell it to receive. Go back to my SSH seesion and :-

Quote
# cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:Apr 30 2006
0: uart:PXA UART port:F8100000 irq:22 baud:460800 tx:5 rx:0 CTS|DSR|CD|RI
1: uart:PXA UART port:F8200000 irq:21 baud:9600 tx:0 rx:0 RTS|DTR
2: uart:PXA UART port:F8700000 irq:20 baud:460800 tx:0 rx:0
#

Does this not prove that the IR is on ttyS1?
« Last Edit: May 01, 2006, 08:02:59 am by Mjolinor »

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #263 on: May 01, 2006, 11:07:06 am »
As you say (Albertr) it is in fact ttyS1. I don't know why using the the IR sets the TX on ttyS1 but if I cat "a file" >> /dev/ttyS1 I can watch it with my scope.

The problem is the reset as suggested earlier. According to teh datasheet there is no need for a power up sequence if the three power supplies are connected to a common V but it only respponds correctly if I reset it after power up.

It now scans and finds things so it would seem to be installed correctly, working kernel and so on. Now need to sort the power on off I think. I suppose it's actually best to do this mechanically as I willprobably be using this thing on aeroplanses and you can't beat a mechanical connection for being sure.
« Last Edit: May 01, 2006, 11:19:36 am by Mjolinor »

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #264 on: May 01, 2006, 11:44:34 am »
Good to hear that you have sorted it out! I'm using software power control via GPIO pin, which is IMHO more convenient than any hardware switch.

Not sure why IRDA applet in Cacko resets ttyS1 speed. Did you try to send/receive via IRDA after your modification? Does IRDA still work?

-albertr

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #265 on: May 01, 2006, 05:12:32 pm »
My not initialising problem is to do with the rise time of the power supply on the Zaurus. The spec. sheet for the BT module says reset at power on isn't needed and no power on sequence is required if the three power supply lines are commoned. This isn't what I was seeing so a closer look reveals that the power supply rise time has to be < 62 us and the actual rise time internally is > 200 us so that's why it isn't working without a reset.

This means that I either wire the reset or wire the PSU either through a transistor or a manual switch. Power supply makes more sense as powering it off is a requirement so I need an I/O line that's suitable, the ones in the battery compartment look favourite but I need some input on the software side or it's going to be a switch on the outside.

Input please.
« Last Edit: May 01, 2006, 05:15:02 pm by Mjolinor »

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #266 on: May 02, 2006, 04:23:13 pm »
On my page there's a link to the userland utility that I use to control the power thru GPIO pin.
Just change the pin number to the one you use, should be as easy as that.
-albertr

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #267 on: May 02, 2006, 04:26:35 pm »
I looked at that. It's the thought of compiling it
I'll give it a go.

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #268 on: May 04, 2006, 10:28:31 am »
Compiled fine. Being a lazy git I decided to try GPIO 84 so I didn't have to take the MB out of the top half.

Suffered from minor panic when met with a flashing green LED and naff all else, as soon as power is applied.

It would seem that if there is 10 k or less to ground on GPIO 84 when either the battery is put in or external power is applied the Z goes into some strange mode.

I couldn't get it to do anything though I didn't try too hard due to the "oh no I've trashed my Z" palpitations in my chest.
« Last Edit: May 04, 2006, 10:32:04 am by Mjolinor »

Mjolinor

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #269 on: May 04, 2006, 10:39:29 am »
Having decided that GPIO 84 aint going to cut it I need another one on the top of the board.

The BT module only works if I specify "noflow" during hciattach so CTS and RTS are not needed. Are they disab;ed in the modified serial driver?

Can I use one of these or is it unsafe because of the serial routines?

If I can use it what is it's I/O number?

Is there easy access on this side of the board to any other spare I/O line?

Is GPIO 35 available on this side?
« Last Edit: May 04, 2006, 10:42:11 am by Mjolinor »