DA14580, linux HCI/bluez

13 posts / 0 new
Last post
光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
DA14580, linux HCI/bluez

Dear all,

我正在尝试将DA14581 PATCH RAM代码端口到DA14580,具有不同的ROM内容。

So, here whai i did until now:

1.从DA14581_HCI_RELEASE_V.1110.2.12启动DA14581
2. On the uVision project i applied DA14580 scatter file from DA1458x_SDK_3.0.6
3. On the uVision project i applied "rom_symdef" as per DA14580 apps into DA1458x_SDK_3.0.6
4.加载与修补hciattach,我可以上传e firmware correctly
5. I can compile without errors. After FW is uploaded and executed, there is no HCI reply, so hciattach times out.
6. actually, code execution locks into "rwip_init" as below:

#ifdef radio_580
iq_trim_from_otp();
# endif

/*
************************************************************************************
* BLE初始化
************************************************************************************
* /

init_pwr_and_clk_ble();
//diagnostic();

// rf_init(&rwip_rf);
// setbits32(ble_radiocntl1_reg,xrfsel,3);

#funalibrated_at_fab.
SetBits16(BANDGAP_REG, BGR_TRIM, 0x0); // trim RET Bandgap
SetBits16(BANDGAP_REG, LDO_RET_TRIM, 0xA); // trim RET LDO
SetWord16(RF_LNA_CTRL1_REG, 0x24E);
setword16(rf_lna_ctrl2_reg,0x26);
SetWord16(RF_LNA_CTRL3_REG, 0x7);
SetWord16(RF_VCO_CTRL_REG, 0x1);
setBits16(CLK_16M_REG,RC16M_TRIM,0xA);
# endif

// Initialize BLE stack
nvic_clearpendingirq(ble_slp_irqn);
nvic_clearpendingirq(ble_event_irqn);
nvic_clearpendingirq(ble_rf_diag_irqn);
nvic_clearpendingirq(ble_rx_irqn);
NVIC_ClearPendingIRQ(BLE_CRYPT_IRQn);
nvic_clearpitchingirq(ble_finetgtim_irqn);
NVIC_ClearPendingIRQ(BLE_GROSSTGTIM_IRQn);
NVIC_ClearPendingIRQ(BLE_WAKEUP_LP_IRQn);

>>> rwip_init(error);

#if ((BLE_APP_PRESENT == 0 || BLE_INTEGRATED_HOST_GTL == 1) && BLE_HOST_PRESENT )
patch_gtl_task();
# endif// #if (BLE_APP_PRESENT == 0 || BLE_INTEGRATED_HOST_GTL == 1)

每个帮助都得到了赞赏。
Best regards,
angelo

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
我分享我的进步,

我分享我的进步,hopefully they can be useful for someone, and maybe dialog can support me a bit on this.

实际上,我看到UART调试,所有代码都在ARCH_MAIN.c主循环中执行。
召唤后

#if (BLE_HCIC_ITF)
// In split mode, initialize the HCI
hci_init(rwip_eif_get(RWIP_EIF_HCIC));
# endif//BLE_HCIC_ITF

in rwble.c , i cannot use uart anymore for debugging, since it's controlled from the HCI layer.
So code executes, but there is no reply to first HCI commands sent to the module
just after fw update.
HCI part is only available currently as object.
通过范围我看到了FW,刚刚显示了CRC OK ID,我看到Linux在TX线上发送了第一个HCI命令,4个字节,从模块侧只接收到一些ACK位。

JE_Dialog
离线
Last seen:11 hours 56 min ago
Staff
加入:2013-12-05 14:02
Hi There, we are aware of an

Hi There, we are aware of an issue related to Blue Z... "The reason is that BlueZ sends some HCI commands for standard and not BLE controller and this gets our device mixed up".. We are looking into a patch, but this is some weeks away right now. BR JE_Dialog

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
嗨,很高兴知道,我是

嗨,很高兴知道,我正在进行,如果我成功,我可以发布补丁。

What i have seen is:
With oscilloscope i see there is a UART reply, but of 2 bytes, 0x04 and 0x10. This is why current hciattach is not showing anything and times out, since hciattach.c read_hci_event() expects other bytes, at least 3 (byte 3 is params count).

So i modified hciattach to see what the return code is: i get

BASH-3.2#.hciattach TTYMXC1对话框115200
Downloading hci-firmware.bin...
CRC OK (cd).
Sending HCI reset before starting conversation...
对话框自定义协议:EVT_HARDWARE_ERROR

Hardware error. Is it possible the code is for da14581 and checks some manufact id, or is it possible my module is damaged ? In the meantime i test on another board.

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
Well, hw error was just due

Well, hw error was just due to the global "error" variable uninitialized.
似乎我可以发送HCI消息如果从主循环应用程序排队,但HCI线程/模块本身未回复我发送的任何消息。

这似乎与DA14580的不同ROM内核代码有关。

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
大家好,

大家好,
progressed again.
- still with a mix of da14580, da14581 code (DA14581_HCI_Release_v.3.110.2.12) and SDK 3.0, c file / scatter file mix, and keeping da14580 symdefs
- also, i replaced some uart functions from uart.c driver
- also, i added HCI tasks in the last part of the jump table, that was not defined for da14580
- 同样,对于仍有澄清的主题原因,我必须在Arch_main.c函数中的主循环之前“UART_FLOW_OFF_FUNC”。

bash-3.2#./start.sh
Downloading hci-firmware.bin...
CRC OK(90)。
Sending HCI reset before starting conversation...
resp: 03 0c

===============================================
HCI版:蓝牙核心规格4.0(0x06)
WARNING : module's manufacturer is not Dialog Semiconductor (0x0060)!!!
HCI修订:0x0706
模块LMP版本:0x06
Module LMP sub-version : 0x0706
Device setup complete
bash-3.2#hciconfig
hci0: Type: BR/EDR Bus: UART
BD地址:00:13:43:0D:09:83 ACL MTU:0:0 SCO MTU:0:0
DOWN
Rx字节:64 ACL:0 SCO:0事件:5错误:0
TX bytes:20 acl:0 sco:0 commands:5 errors:0

But still there are some issues powering on:

bash-3.2#hciconfighci0 up
Bluetooth: hci0 command 0x1003 tx timeout
Bluetooth: hci0 command 0x1001 tx timeout
蓝牙:HCI0命令0x1009 TX超时
无法init设备hci0:连接超时(110)

也许我现在面临上面提到的问题?
Will continue next week.

Reagrds

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
仍然是一步,

仍然是一步,
我解决了一些UART流控制问题,实际上是沟通是正确的。

But seems the firmware is actually not replying correctly to "Read Class of Device " command,
and strangely MTU values are read as 0.

bash-3.2# Bluetooth monitor ver 5.14
= New Index: 00:13:43:0D:09:83 (BR/EDR,UART,hci0) [hci0] 0.657956

bash-3.2#hciconfighci0 up
< HCI Command: Read Local Supported Fea.. (0x04|0x0003) plen 0 [hci0] 8.186353
> HCI事件:命令完成(0x0E)PLEN 12 [HCI0] 8.672730
Read Local Supported Features (0x04|0x0003) ncmd 10
状态:成功(0x00)
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Read Local Version Infor.. (0x04|0x0001) plen 0 [hci0] 8.672877
> HCI事件:命令完成(0x0E)PLEN 12 [HCI0] 8.677712
阅读本地版本信息(0x04 | 0x0001)NCMD 10
状态:成功(0x00)
HCI version: Bluetooth 4.0 (0x06) - Revision 1798 (0x0706)
LMP version: Bluetooth 4.0 (0x06) - Subversion 1798 (0x0706)
Manufacturer: RivieraWaves S.A.S (96)
< HCI Command: Read BD ADDR (0x04|0x0009) plen 0 [hci0] 8.677804
> HCI Event: Command Complete (0x0e) plen 10 [hci0] 8.682438
Read BD ADDR (0x04|0x0009) ncmd 10
状态:成功(0x00)
Address: 00:13:43:0D:09:83 (Matsushita Electronic Components (Europe) GmbH)
< HCI Command: Read Buffer Size (0x04|0x0005) plen 0 [hci0] 8.682617
> HCI Event: Command Complete (0x0e) plen 11 [hci0] 8.687327
Read Buffer Size (0x04|0x0005) ncmd 10
状态:成功(0x00)
ACL MTU: 0 ACL max packet: 0
SCO MTU: 0 SCO max packet: 0
> HCI事件:命令完成(0x0E)PLEN 4 [HCI0] 8.691511
读取类设备(0x03 | 0x0023)NCMD 10
状态:未知HCI命令(0x01)

Some other info:

bash-3.2# cd blue/
bash-3.2#./start.sh
Downloading hci-firmware.bin...
CRC OK(18)。
Sending HCI reset before starting conversation...
resp: 03 0c

===============================================
HCI版:蓝牙核心规格4.0(0x06)
制造商:Rivierawaves SAS(0x0060)
HCI修订:0x0706
模块LMP版本:0x06
Module LMP sub-version : 0x0706
Device setup complete

bash-3.2#hciconfighci0 up
Can't init device hci0: Invalid request code (56)

BASH-3.2#DMESG |grep蓝色
[0.312654]蓝牙:核心版本2.16
[0.312693]蓝牙:HCI设备和连接管理器初始化
[ 0.312705] Bluetooth: HCI socket layer initialized
[0.312716]蓝牙:L2CAP套接字层初始化
[ 0.312737] Bluetooth: SCO socket layer initialized
[ 3.675536] Bluetooth: HCI UART driver ver 2.2
[3.678705]蓝牙:HCI H4协议初始化
[3.682216]蓝牙:HCI BCSP协议初始化
[ 3.685916] Bluetooth: HCILL protocol initialized
[4.653492]蓝牙:RFCOMM TTY层初始化
[4.657130]蓝牙:RFCOMM套接字层初始化
[ 4.660993] Bluetooth: RFCOMM ver 1.11
[4.663465]蓝牙:BNEP(以太网仿真)Ver 1.3
[ 4.667507] Bluetooth: BNEP filters: protocol multicast
[4.671459]蓝牙:BNEP套接字层初始化
[ 4.675154] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[4.679800]蓝牙:初始化HIDP套接字层

bash-3.2#hciconfig-a
hci0: Type: BR/EDR Bus: UART
BD地址:00:13:43:0D:09:83 ACL MTU:0:0 SCO MTU:0:0
DOWN
RX字节:640 ACL:0 SCO:0事件:50错误:0
TX bytes:200 acl:0 sco:0 commands:50 errors:0
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DH1 HV1
Link policy:
Link mode: SLAVE ACCEPT

bash-3.2#hciconfighci0 up
Can't init device hci0: Invalid request code (56)

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
Ok, seems at least main

Ok, seems at least main features now work.

bash-3.2#hciconfig-a
hci0: Type: BR/EDR Bus: UART
BD Address: 00:13:43:0D:09:83 ACL MTU: 27:18 SCO MTU: 0:0
UP RUNNING
RX字节:339 ACL:0 SCO:0事件:37错误:0
Tx字节:370 ACL:0 SCO:0命令:37错误:0
特点:0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
Packet type: DM1 DH1 HV1
Link policy:
Link mode: SLAVE ACCEPT

bash-3.2#hciconfig hci0领先

我看到从手机检测到的模块。

Sbourahla.
离线
Last seen:5年5个月前
Expert
加入:2015-02-25 09:51
你好谱,

你好谱,

我很有趣,你如何解决你的问题,我试着做同样但实际上它不起作用。

BR

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
Hi sbourahla,

Hi sbourahla,
i did many changes to original "DA14581_HCI_Release_v.3.110.2.12" package, ending up with a PAN1740 compatible fw.
我现在正在寻找许可证的东西,让我们看看我是否可以共享UVISION项目。
在分享之前,我也会做一些更多的测试。

Best regards
angelo

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
你好,

你好,
在一些测试似乎至少有一些连接问题后:

$ sudo gatttool -b 00:13:43:0D:09:83 -I
[00:13:43:0D:09:83][LE]> connect
试图连接到00:13:43:0D:09:83
[00:13:43:0D:09:83][LE]> < HCI Command: LE Create Connection (0x08|0x000d) plen 25 [hci0] 8.243814
Scan interval: 60.000 msec (0x0060)
Scan window: 30.000 msec (0x0030)
Filter policy: White list is not used (0x00)
Peer address type: Public (0x00)
Peer address: 00:13:43:0D:09:83 (Matsushita Electronic Components (Europe) GmbH)
Own address type: Public (0x00)
Min connection interval: 50.00 msec (0x0028)
最大连接间隔:70.00毫秒(0x0038)
Connection latency: 0x0000
Supervision timeout: 420 msec (0x002a)
最小连接长度:0.000毫秒(0x0000)
Max connection length: 0.000 msec (0x0000)
> HCI事件:命令状态(0x0F)PLEN 4 [HCI0] 8.248374
LE Create Connection (0x08|0x000d) ncmd 1
状态:成功(0x00)
> HCI Event: LE Meta Event (0x3e) plen 19 [hci0] 15.921321
LE Connection Complete (0x01)
状态:成功(0x00)
Handle: 72
Role: Master (0x00)
Peer address type: Public (0x00)
Connection successful
[00:13:43:0D:09:83]>对等地址:00:13:43:0D:09:83(Matsushita电子元件(欧洲)GmbH)
Connection interval: 70.00 msec (0x0038)
Connection latency: 0.00 msec (0x0000)
Supervision timeout: 420 msec (0x002a)
Master clock accuracy: 0x00
@设备连接:00:13:43:0D:09:83(1)标志0x0000
> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 16.411320
状态:成功(0x00)
Handle: 72
Reason: Connection Timeout (0x08)
@ Device Disconnected: 00:13:43:0D:09:83 (1) reason 1

似乎最终断开在靠近主管超时后到达。

Now i don't know if this is an issue visible also on da14581 or if it can be something related to my modified firmware.
Is there anyone with HCI on da14581 working properly ?

问候
angelo

光谱
离线
Last seen:5 years 9 months ago
加入:2015-03-11 18:26
你好,

你好,
我分享我此时的代码。仍然连接不正常工作,在连接成功后,断开连接。

https://github.com/spectrum70/pan1740-firmware

Best regards
angelo

JE_Dialog
离线
Last seen:11 hours 56 min ago
Staff
加入:2013-12-05 14:02
Hi Spectrum, we have

嗨Spectrum,我们在DA14581中使用外部MPU成功使用HCI。我们有一个内部项目,在我们发言时致力于蓝Z实施(第三方正在为我们致力于这一问题)。

Do you have a 14581 set-up to test ? you could re-build your image for 14581 and test.

BR JE_Dialog