各位,
i am trying to port da14581 patch RAM code to da14580, that have different ROM content.
所以,在这里,我才才才到目前为止:
1. Started from DA14581_HCI_Release_v.3.110.2.12 package for da14581
2.在UVISION项目中,我从DA1458x_sdk_3.0.6应用DA14580分散文件
3.在UVISION项目上,我将“ROM_SYMDEF”应用于DA1458X_SDK_3.0.6
4.加载与修补hciattach,我可以上传e firmware correctly
我可以没有错误编译。在上传和执行FW之后,没有HCI回复,因此HCIATTACH超时。
6. actually, code execution locks into "rwip_init" as below:
#ifdef RADIO_580
iq_trim_from_otp();
#endif
/*
************************************************************************************
*BLE initialization
************************************************************************************
*/
init_pwr_and_clk_ble();
//diagnostic();
// rf_init(&rwip_rf);
// SetBits32(BLE_RADIOCNTL1_REG, XRFSEL, 3);
#if UNCALIBRATED_AT_FAB
setbits16(bandgap_reg,bgr_trim,0x0);//修剪Ret带隙
setbits16(bandgap_reg,ldo_ret_trim,0xa);//修剪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
//初始化ble堆栈
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_ClearPendingIRQ(BLE_FINETGTIM_IRQn);
NVIC_ClearPendingIRQ(BLE_GROSSTGTIM_IRQn);
NVIC_ClearPendingIRQ(BLE_WAKEUP_LP_IRQn);
>>> Rwip_init(错误);
#if ((BLE_APP_PRESENT == 0 || BLE_INTEGRATED_HOST_GTL == 1) && BLE_HOST_PRESENT )
patch_gtl_task();
#endif // #if(ble_app_present == 0 || ble_integrate_host_gtl == 1)
Every help is appreciated.
此致,
angelo

我分享我的进步,希望他们对某人有用,也许对话可以支持我。
Actually, i see debugging over uart, that all the code executes in the arch_main.c main loop.
After calling
#if (BLE_HCIC_ITF)
/ /在分裂模式中,初始化人机交互
hci_init(rwip_eif_get(rwip_eif_hcic));
#endif // ble_hcic_itf.
在Rwble.c中,我不能使用UART来调试,因为它是从HCI层的控制。
所以代码执行,但没有回复发送到模块的第一个HCI命令
just after fw update.
HCI部分仅作为对象可用。
By scope i see FW is sent, justafter the CRC OK id displayed, i see linux sending the first HCI command, 4 bytes on TX line, and from module side only some ack bits after each bite received.
在那里,我们知道与蓝Z相关的问题......“Bluez是Bluez为标准而不是BLE控制器发送一些HCI命令,这让我们的设备混在一起”..我们正在调查补丁,但是这是现在几个星期的距离。BR JE_DIALOG.
Hi, good to know, i am progressing, if i succed i can publish the patch then.
我所看到的是:
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).
所以我修改了HCIATACH,看看返回码是什么:我得到了
bash-3.2# .hciattach ttymxc1 dialog 115200
下载HCI固件.bin ...
CRC OK(CD)。
在开始对话之前发送HCI重置...
Dialog custom protocol: 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.
Well, hw error was just due to the global "error" variable uninitialized.
Seems i can send HCI messages if queued from main loop app, but HCI thread / module itself is not replying to any message i send.
This seems to be related to the different ROM kernel code of da14580.
Hi all,
再次进展。
- 仍然具有DA14580,DA14581代码(DA14581_HCI_REASE_V.3.110.2.12)和SDK 3.0,C文件/分散文件组合的混合,并保持DA14580 Symdefs
- 另外,我从UART.C驱动程序中替换了一些UART函数
- 另外,我在跳转表的最后一部分中添加了HCI任务,没有为DA14580定义
- also, for misterious reasons still to clarify, i had to "uart_flow_off_func" before the main loop in arch_main.c function.
bash-3.2# ./start.sh
下载HCI固件.bin ...
CRC OK (90).
在开始对话之前发送HCI重置...
resp: 03 0c
===============================================
HCI ver: Bluetooth Core Spec 4.0 (0x06)
WARNING : module's manufacturer is not Dialog Semiconductor (0x0060)!!!
HCI revision : 0x0706
Module LMP version : 0x06
模块LMP子版:0x0706
Device setup complete
bash-3.2# hciconfig
HCI0:类型:BR / EDR总线:UART
BD Address: 00:13:43:0D:09:83 ACL MTU: 0:0 SCO MTU: 0:0
下
RX bytes:64 acl:0 sco:0 events:5 errors:0
TX字节:20 ACL:0 SCO:0命令:5错误:0
但仍然存在一些问题:
bash-3.2# hciconfig hci0 up
蓝牙:HCI0命令0x1003 TX超时
蓝牙:HCI0命令0x1001 TX超时
蓝牙: hci0 command 0x1009 tx timeout
Can't init device hci0: Connection timed out (110)
Maybe i am now facing the issue you mentioned above ?
Will continue next week.
Reagrds
Still a step forward,
i solved some uart flow control issues and actually communication is correct.
但似乎固件实际上没有正确回复“读取的设备”命令,
and strangely MTU values are read as 0.
BASH-3.2#蓝牙监视器VER 5.14
=新索引:00:13:43:0D:09:83(BR / EDR,UART,HCI0)[HCI0] 0.657956
bash-3.2# hciconfig hci0 up
> HCI Event: Command Complete (0x0e) plen 12 [hci0] 8.672730
> HCI Event: Command Complete (0x0e) plen 12 [hci0] 8.677712
Read Local Supported Features (0x04|0x0003) ncmd 10
Status: Success (0x00)
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Read Local Version Information (0x04|0x0001) ncmd 10
Status: Success (0x00)
HCI版本:蓝牙4.0(0x06) - 修订版1798(0x0706)
LMP版本:蓝牙4.0(0x06) - Subversion 1798(0x0706)
制造商: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
读取BD addr(0x04 | 0x0009)NCMD 10
Status: Success (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事件:命令完成(0x0E)PLEN 11 [HCI0] 8.687327
Read Buffer Size (0x04|0x0005) ncmd 10
Status: Success (0x00)
ACL MTU: 0 ACL max packet: 0
SCO MTU:0 SCO MAX数据包:0
< HCI Command: Read Class of Device (0x03|0x0023) plen 0 [hci0] 8.687407
> HCI Event: Command Complete (0x0e) plen 4 [hci0] 8.691511
Read Class of Device (0x03|0x0023) ncmd 10
Status: Unknown HCI Command (0x01)
Some other info:
bash-3.2 #cd蓝色/
bash-3.2# ./start.sh
下载HCI固件.bin ...
CRC OK(18)。
在开始对话之前发送HCI重置...
resp: 03 0c
===============================================
HCI ver: Bluetooth Core Spec 4.0 (0x06)
Manufacturer: RivieraWaves SAS(0x0060)
HCI revision : 0x0706
Module LMP version : 0x06
模块LMP子版:0x0706
Device setup complete
bash-3.2# hciconfig hci0 up
Can't init device hci0: Invalid request code (56)
bash-3.2# dmesg | grep Blue
[ 0.312654] Bluetooth: Core ver 2.16
[ 0.312693] Bluetooth: HCI device and connection manager initialized
[ 0.312705] Bluetooth: HCI socket layer initialized
[ 0.312716] Bluetooth: L2CAP socket layer initialized
[0.312737]蓝牙:SCO套接字层初始化
[3.675536]蓝牙:HCI UART驱动程序版本2.2
[ 3.678705] Bluetooth: HCI H4 protocol initialized
[ 3.682216] Bluetooth: HCI BCSP protocol initialized
[3.685916]蓝牙:初始化HCILL协议
[ 4.653492] Bluetooth: RFCOMM TTY layer initialized
[ 4.657130] Bluetooth: RFCOMM socket layer initialized
[ 4.660993] Bluetooth: RFCOMM ver 1.11
[ 4.663465] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 4.667507] Bluetooth: BNEP filters: protocol multicast
[ 4.671459] Bluetooth: BNEP socket layer initialized
[4.675154]蓝牙:HIDP(人力界面仿真)Ver 1.2
[ 4.679800] Bluetooth: HIDP socket layer initialized
bash-3.2#hciconfig -a
HCI0:类型:BR / EDR总线:UART
BD Address: 00:13:43:0D:09:83 ACL MTU: 0:0 SCO MTU: 0:0
下
RX bytes:640 acl:0 sco:0 events:50 errors:0
TX字节:200 ACL:0 SCO:0命令:50错误:0
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
数据包类型:DM1 DH1 HV1
链接策略:
链接模式:从属接受
bash-3.2# hciconfig hci0 up
Can't init device hci0: Invalid request code (56)
好的,似乎至少有主要的功能。
bash-3.2#hciconfig -a
HCI0:类型:BR / EDR总线:UART
BD Address: 00:13:43:0D:09:83 ACL MTU: 27:18 SCO MTU: 0:0
跑步
RX bytes:339 acl:0 sco:0 events:37 errors:0
TX bytes:370 acl:0 sco:0 commands:37 errors:0
Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
数据包类型:DM1 DH1 HV1
链接策略:
链接模式:从属接受
bash-3.2# hciconfig hci0 leadv
And i see the module detected from cell phone.
Hello spectrum,
I am interesting by how you fixed your problem, I try to do the same but actually it doesn't work.
布尔
Hi sbourahla,
我对原始“da14581_hci_release_v.110.2.12”包进行了许多更改,并结束了Pan1740兼容FW。
I am looking now into licence things, let's see if i can share the uVision project.
I would also do some more tests before sharing it.
此致
Angelo
Hi,
well after some testings seems there are at least some connections issues:
$ sudo gatttool -b 00:13:43:0D:09:83 -IScan interval: 60.000 msec (0x0060)
[00:13:43:0D:09:83][LE]> connect
Attempting to connect to 00:13:43:0D:09:83
[00:13:43:0D:09:83] [LE]>
Scan window: 30.000 msec (0x0030)
过滤策略:未使用白色列表(0x00)
PEER地址类型:公共(0x00)
PEER地址:00:13:43:0D:09:83(Matsushita电子元件(欧洲)GmbH)
自己的地址类型:公共(0x00)
最小连接间隔:50.00毫秒(0x0028)
Max connection interval: 70.00 msec (0x0038)
连接延迟:0x0000
Supervision timeout: 420 msec (0x002a)
Min connection length: 0.000 msec (0x0000)
最大连接长度:0.000毫秒(0x0000)
> HCI Event: Command Status (0x0f) plen 4 [hci0] 8.248374
Le创建连接(0x08 | 0x000d)ncmd 1
Status: Success (0x00)
> HCI事件:LE META事件(0x3E)PLEN 19 [HCI0] 15.921321
LE连接完成(0x01)
Status: Success (0x00)
Handle: 72
角色:大师(0x00)
PEER地址类型:公共(0x00)
连接成功
[00:13:43:0D:09:83][LE]> Peer address: 00:13:43:0D:09:83 (Matsushita Electronic Components (Europe) GmbH)
连接间隔:70.00毫秒(0x0038)
连接延迟:0.00 msec(0x0000)
Supervision timeout: 420 msec (0x002a)
主时钟精度:0x00
@ Device Connected: 00:13:43:0D:09:83 (1) flags 0x0000
> HCI事件:断开完整(0x05)PLEN 4 [HCI0] 16.411320
Status: Success (0x00)
Handle: 72
原因:连接超时(0x08)
@设备已断开:00:13:43:0D:09:83(1)原因1
Seems the final disconnection arrives after a time near to the supervisor timeout.
现在我不知道这是一个在da14581上可见的问题,还是可以是与我修改的固件相关的东西。
有没有人在DA14581上工作,正常工作?
Regards
angelo
Hi,
i share the code i have at this point. Still connection is not working properly, disconnection happen just after the connection succeed.
https://github.com/spectrum70/pan1740-firmware
此致
Angelo
嗨频谱,我们有customers using HCI succesfully on DA14581 with external MPU. We have an internal project working on a Blue-Z implementation as we speak (3rd party is working on this for us).
你有14581的设置吗?您可以重新构建图像14581并测试。
BR JE_DIALOG.