DA14681外设I2C和PXP 工程同时工作时导致da14681死机的问题

14 posts / 0 new
Last post
index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
DA14681外设I2C和PXP 工程同时工作时导致da14681死机的问题

请问:
我的使用情况:
硬件: 测试io(p3_5)外接led,外挂eeprom芯片到i2c2(p4_0,p4_1)
软件:
1.配置uart作为调试使用
2.官方pxp_reporter工程,pxp任务正常打开,同时新建 一个1s周期test任务,执行io翻转,代码正常运行.
3.官方pxp_reporter工程,屏蔽掉pxp任务,同时在test任务下新增初始化i2c2,写eeprom地址0x00,数据:0x51,周期读取地址0x00,数据等于0x51,代码正常运行.
#if 0
/* Start the PXP reporter application task. */
OS_TASK_CREATE("PXP Reporter", /* The text name assigned to the task, for
debug only; not used by the kernel. */
pxp_reporter_task, /* The function that implements the task. */
NULL, /* The parameter passed to the task. */
#if (dg_configDISABLE_BACKGROUND_FLASH_OPS == 1)
512年,/ *的字节数to allocate to the
stack of the task. */
#else
768, /* The number of bytes to allocate to the
stack of the task. */
#endif
mainPXP_REPORTER_TASK_PRIORITY, /* The priority assigned to the task. */
handle); /* The task handle. */
OS_ASSERT(handle);
#endif

问题: 当我在恢复pxp任务,同时周期读取i2c2的地址0x00数据时,每次都只能随机的读取几次,之后da14681出现死机情况。
P.S.
1.判断死机的依据是:led灯不能正产翻转点亮,串口无循环数据打印
2.eeprom的驱动是参考sdk包下peripherals_demo工程中的demo_i2c.c

请官方和使用da14681的解决下,非常感谢!

Device:
kingwheat
Offline
Last seen:9 months 1 week ago
Joined:2016-12-08 09:21
你是用的是IIC的异步方式吗?是不是有IIC读写回调的那种

你是用的是IIC的异步方式吗?是不是有IIC读写回调的那种?

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
不是,我用的同步方式。 你用异步回调可以不冲突么?

不是,我用的同步方式。 你用异步回调可以不冲突么?

kingwheat
Offline
Last seen:9 months 1 week ago
Joined:2016-12-08 09:21
你看一下,你有没有在IIC的操作里面,调用了 OS

你看一下,你有没有在IIC的操作里面,调用了 OS_EVENT_WAIT(dev_config->bus_data->event, OS_EVENT_FOREVER);
不知道你具体是怎么配置的。但是我之前试过,偶尔会因为这个的回调没有,导致永久阻塞。

Jelphi
Offline
Last seen:2 months 3 weeks ago
Staff
Joined:2015-09-10 12:07
i2c 的使用要调用Dialog SDK I2C

i2c 的使用要调用Dialog SDK I2C ADAPTOR, Peripheral sample project has such sample

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
3q,使用adaptor对应的i2c访问外设时,问题解决。

3q,使用adaptor对应的i2c访问外设时,问题解决。

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
hi Jelphi,

hi Jelphi,
再请问一个i2c的问题,我使用ad函数读写at24c32,每次上电使用freertos的软件定时器周期触发读写,
但是第一次读写总是不成功,但是之后定时器触发同样的读写操作都成功了。

请问这是什么问题?
同样的我在system_init()初始化读写at24c32也不成功,但是再任务中周期调用at24c32_test(); 是操作成功的。
/* Initialize BLE Adapter */
ad_ble_init();
/* Initialize BLE Manager */
ble_mgr_init();
// 读写at24c32
at24c32_test(); /******************读写失败********************/
/* Start the PXP reporter application task. */
OS_TASK_CREATE("PXP Reporter", ... ...
非常期待回复!

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
请问下这个问题如何解决?

请问下这个问题如何解决?
同样的函数at24c32_test()在任务中周期调用都可以成功操作,但是在初始化的时候就无法成功读写。

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
有技术支持,支持下么?

有技术支持,支持下么?

gwjgwgshxd
Offline
Last seen:2 years 10 months ago
Joined:2016-12-14 10:52
会不会是I2C还没有初始化完成嘞?

会不会是I2C还没有初始化完成嘞?

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
我的测试代码,是在i2c相关的初始化代码后面的

我的测试代码,是在i2c相关的初始化代码后面的,其他有遇到类似情况的人么?希望得到技术支持。

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
没人遇到类似的问题么,求指导。

没人遇到类似的问题么,求指导。

gwjgwgshxd
Offline
Last seen:2 years 10 months ago
Joined:2016-12-14 10:52
我现在也遇到了这样的问题,正常运行几次就死机了

我现在也遇到了这样的问题,正常运行几次就死机了。我还是用的手册上给的例子。
I2C_dev = ad_i2c_open(M41T62);
ad_i2c_transact(I2C_dev,TX,1,RX,7);
ad_i2c_close(I2C_dev);
而且我发现经常不知道什么原因就死机了,不知道你们有没有遇到类似问题。

index219
Offline
Last seen:1 year 3 months ago
Joined:2016-05-23 07:00
你改用异步写操作就可以了,可以参考官方demos

你改用异步写操作就可以了,可以参考官方demos:eeprom_24XX256_read.c .h