www.oSLIK.ru

:: Second Generation ::

Часовой пояс: UTC + 3 часа [ Летнее время ]

Текущее время: Вт дек 18, 2018 7:19 pm




Начать новую тему Ответить на тему  [ Сообщений: 9 ] 
Автор Сообщение
 Заголовок сообщения: Bluetooth on sx1
СообщениеДобавлено: Ср фев 28, 2007 12:49 pm 
Не в сети
Уже Не Новичок
Уже Не Новичок

Зарегистрирован: Ср окт 04, 2006 2:56 pm
Сообщения: 47
Thanks, vladimir. After powering the bluetooth up, i can see the bluetooth chip trying to communicate with me. (If I do cat /dev/ttyS0 & cat /dev/zero > /dev/ttyS0, I see groups of characters as a response).

Unfortunately I was not able to hciattach with any combination of options I failed.

I noticed that there's hack modifying speed of ttyS1. Is something similar needed for ttyS0?

_________________
zblabunk, aka Pavel Machek


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Ср фев 28, 2007 1:56 pm 
Не в сети
Z-Team member
Z-Team member
Аватара пользователя

Зарегистрирован: Чт авг 19, 2004 2:32 pm
Сообщения: 896
AFAIK ttyS0 should be at 115200 8N1 with RTS enabled.
Maybe GPIO8 (GSM_WAKEUP_BT) should be set somehow.

I will investigate this.

PS. The hack modifying speed of ttyS1 is needed to set its speed to 384000 (it is non-standart) and enable RTS/CTS flow control (driver only allows to set RTS flow control).
Seems that this is not needed to ttyS0.

_________________
Google Nexus One + Siemens SX1 McLaren


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Пт июн 08, 2007 7:14 pm 
Не в сети
Новичок
Новичок

Зарегистрирован: Пн май 21, 2007 6:23 pm
Сообщения: 11
hello,

Vovan888 писал(а):
AFAIK ttyS0 should be at 115200 8N1 with RTS enabled.
Maybe GPIO8 (GSM_WAKEUP_BT) should be set somehow.


I tried to play with bt module and I found following:

0. initial speed is set to 115200Bd, 8N1, no flow control

1. every time I try to send some command, the module responds with vendor-specific event. I tried reset and inquiry hci commands and only for reset I got '04 0e' -- event 'command accepted' (before that vendor-specific event).

2. The same happens when I turn on or off the module:
-bash-2.05b# echo "0" >bt_power
-bash-2.05b# echo "1" >bt_power
(simultaneously) -bash-2.05b# hex /dev/ttyS0
0x00000000: 04 ff 02 05 02
/means: event 0xff (vendor-specific), data 0x05 0x02/

3. I have no bluemoon detailed docs, so I expect that the event should mean following: "Infineon event: BD-Data invalid (check EEPROM)."

4. gpio8 seems to have no effect (for now).

Could you help me somehow to move forward? Do I have damaged module? But it works under symbian, so maybe this is how siemens designed the phone.


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Пт июн 08, 2007 9:44 pm 
Не в сети
Z-Team member
Z-Team member
Аватара пользователя

Зарегистрирован: Чт авг 19, 2004 2:32 pm
Сообщения: 896
I havnt looked in symbian firmware how it does bluetooth module setup.
But I think it uses some data from EEPROM of EGOLD:
-there is one IPC message - BtBdDataFromEEliteReq, that reads some data from egold (seems that it is eeprom block 218) , on my SX1 it contains this 60 bytes (its length is fixed and should be 60 bytes):
Код:
81 AA 50 E3 01 00 00 00 3A 39 38 37 36 35 34 32
32 31 FF FF 1B 05 10 00 70 00 02 02 02 02 8C 0C
12 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
16 EF FA 19 00 00 00 00 00 04 02 72


Now, lets look at this proc (from testsvr.exe):
Код:
50E1E72C             ; CHCIClient::Infineon_Write_BD_DataL(void)
...
50E1E732 18 49                 LDR   R1, =0xFC15
50E1E734 FF F7 8E FC           BL    CHCIClient__NewCommand_unsigned_short_


then it loads 60 bytes of BtBd data (from EEPROM block 218) to local buffer
and then:
Код:
50E1E786 FF F7 25 FC           BL    CHCIClient__TryToSendCommand_void_


I hope it will help you...

Also there are some another vendor specific (maybe not all of them) commands:
Код:
VendorDebugCommand - 0xFC8D  (its argument is 4 bytes long)
ScanEnable - 0xC1A
ReadScanEnable - 0xC19
WriteConnectionAcceptTimeout - 0xC16
AcceptConnect - 0x409
HCIReset - 0xC03

BT_Standby - 0xFC09
Infineon_Test_Mode - 0xFC1A (its argument is 2 bytes long)
Infineon_Manufacturer_Mode - 0xFC11  (its argument is 2 bytes long)

_________________
Google Nexus One + Siemens SX1 McLaren


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Пн июн 11, 2007 3:17 pm 
Не в сети
Новичок
Новичок

Зарегистрирован: Пн май 21, 2007 6:23 pm
Сообщения: 11
Vovan888 писал(а):
I hope it will help you...


Thanks a lot! I have now hci interface working. I have not tested it thorougly, but at least 'hcitool inq' works for now. After turning bt power on via sofia, I have initialized it by using following three scripts. Scripts are run in the same order as written. Output is redirected into /dev/ttyS0.

mfg_mode.sh:
Код:
#!/bin/bash
echo -n -e '\1\21\374\2\1\0'


bd_data.sh:
Код:
#!/bin/bash
echo -n -e '\1\25\374\74\201\252\120\343\1\0\0\0\72\71\70\67\66\65\64\62\62\61\377\377\33\5\20\0\160\0\2\2\2\2\214\14\22\1\2\3\4\5\6\7\10\11\20\21\22\23\24\25\26\357\372\31\0\0\0\0\0\4\2\162'


leave_mfg_mode.sh:
Код:
#!/bin/bash
echo -n -e '\1\21\374\2\1\0'


Then, even generic 'hciattach /dev/ttyS0 any 115200 noflow' will work. But hciattach doesn't know how to change the baudrate for infineon, so speed is only 115kBit/s for now. I will try to make the module work at a higher baudrate.

Vovan888 писал(а):
Also there are some another vendor specific (maybe not all of them) commands:
Код:
VendorDebugCommand - 0xFC8D  (its argument is 4 bytes long)
ScanEnable - 0xC1A
ReadScanEnable - 0xC19
WriteConnectionAcceptTimeout - 0xC16
AcceptConnect - 0x409
HCIReset - 0xC03

BT_Standby - 0xFC09
Infineon_Test_Mode - 0xFC1A (its argument is 2 bytes long)
Infineon_Manufacturer_Mode - 0xFC11  (its argument is 2 bytes long)


Commands from ScanEnable to HCIReset are standard and well documented hci commands. The docs for these are at bluetooth.org.

FYI, Vendor-specific commands are only the commands beginning with 0xFC.., Vendor-specific events have code beginning with 0xff.


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Вт июн 12, 2007 7:51 pm 
Не в сети
Новичок
Новичок

Зарегистрирован: Пн май 21, 2007 6:23 pm
Сообщения: 11
hello,

Is there anybody here, who can switch uart speed on omap to, say, 1MBaud? I tried to switch uartclk to 48MHz (instead of default 12MHz), and I think that using sx1 cpu as omap1510 is incorrect. If I try to switch to 48MHz, it seems that uart clock is stopped or the clock is slower than before. Maybe I did some mistake, who knows, but it seems impossible to me now. :-(

I have successfully tested switching of the infineon uart to almost any speed, but afaik omap in linux cannot follow it very high.

I can switch uart to 750kBaud (theoretically, not tested it yet), but there are two things I don't like:
1. rate error about 2% between infineon and omap
2. non-standard speed.


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Ср июн 13, 2007 3:08 pm 
Не в сети
Z-Team member
Z-Team member
Аватара пользователя

Зарегистрирован: Чт авг 19, 2004 2:32 pm
Сообщения: 896
The fastest speed used in Symbian fw on OMAP serial ports is 375KBit/s.
So i think we should start from this speed.
But to set 375Kbits we should apply a patch to kernel serial driver, like the one used on ttyS1 (UART2)

_________________
Google Nexus One + Siemens SX1 McLaren


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: Чт июн 14, 2007 4:03 pm 
Не в сети
Новичок
Новичок

Зарегистрирован: Пн май 21, 2007 6:23 pm
Сообщения: 11
Vovan888 писал(а):
The fastest speed used in Symbian fw on OMAP serial ports is 375KBit/s.
So i think we should start from this speed.
But to set 375Kbits we should apply a patch to kernel serial driver, like the one used on ttyS1 (UART2)


Ok, I will try it. I guess it wil take me some time, because there are some communication issues with the module (even on slow speeds) I am trying to resolve now. 'hcitool inq' runs correctly, but 'hcitool scan' returns somehow shifted values.

Today I tested standby mode. Entering standby:
Код:
echo -n "0" >/proc/gpio/GPIO8
echo -n -e '\1\11\374\4\0\0\0\0' >/dev/ttyS0


leaving standby:
Код:
echo -n "1" >/proc/gpio/GPIO8


(I sent you the code for the proc gpio interface by email, it is one of the patches)


Вернуться к началу
 Профиль  
 
 Заголовок сообщения: it seems it works now
СообщениеДобавлено: Пт июн 15, 2007 2:17 pm 
Не в сети
Новичок
Новичок

Зарегистрирован: Пн май 21, 2007 6:23 pm
Сообщения: 11
hello,

it seems it all works now. 'hcitool scan' works as expected. Again, I have sent you updated code to mail. So, please test.

The only thing I know as not working is power management -- because I didn't written the code for it inside kernel.


Вернуться к началу
 Профиль  
 
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 9 ] 

Часовой пояс: UTC + 3 часа [ Летнее время ]


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Black by Daz (FI) :: Ported to phpBB3 by NeXur.
Русская поддержка phpBB

[ Time : 0.081s | 11 Queries | GZIP : Off ]