Codeless I2C does not work properly on DA14531 TINY module

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
11 posts / 0 new
Last post
Sergei Bezroukov
Offline
Last seen:6 months 3 weeks ago
加入:2020-06-25 00:28
Codeless I2C does not work properly on DA14531 TINY module

Hi there,

I use DA14531 TINY module with Codeless SDK 6.380.10.4 and factory compiled codeless_531_standalone_set_two.hex image along with TI's HDC1000 sensor. Problems occur when I read or write to sensor registers.

By reading a register, the commands are as follows (see attached console session):

AT+IOCFG=9,7

AT+IOCFG=8,8

AT+I2CCFG=7,100,16

AT + I2CREAD = 0x40,0xFE

Here 0x40 is the sensor I2C address, and 0xFE is the sensor register address. This way the 2-byte sensor's manufacturer ID should be read. However, only the 1st ID byte is read and by reading the 2nd byte the module geherates just 8 SCL pulses to the sensor (instead of 9) and hangs. See attached Logic Analyser image. Pull-up I2C resistors are 4.7K, so they are not an issue. After about 3 minutes the module resets itself and prints +READY in the terminal window. All previous configuration of I2C pins is reset and forgotten.

By writing to the senswor config register, the module composes the right number of SCL pulses, but does not compose the STOP condition at the end of communication and leaves the SCL line low. The writing is done by the following command, see the logic analyser image attached:

AT+I2CWRITE=0x40,2,0

where 2 is the sensor register address, and 0 is the value to write.

我还尝试了其他传感器和1-和2字节寄存器的组合。没有什么可以按预期工作。

问题:这是一个已知的问题与国防部ule and one should wait for a new firmware release or there is a way to fix it?

Attachment:
PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

感谢您的跟进问题和您的反馈。让我检查一下,我会回复你。

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

为延迟道歉。所以,如果我明白目前,这可以在〜3分钟后复制,是正确的吗?请问模块是否与对等设备连接,或者只是广告?

Before the module resets itself (before 3min), can you please clarify if the I2C commands are working properly ?

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen:6 months 3 weeks ago
加入:2020-06-25 00:28
Out of all I2C commands only

Out of all I2C commands only I2CCFG works properly. I have not managed to make any other I2C command working. When I experiment with I2C commands, the module just advertises and is not connected to any client. By sending READ the module produces only 8 clocks by reading the last byte and hangs (does not even say OK on terminal) and resets itself after 3 min. By sending WRITE the module responds with OK and does not reset itself. However in this case it does not compose the STOP condition and keeps the I2C bus busy by grounding the clock pin.

PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

非常感谢您的额外输入。我会将这种行为在内部升级到团队,我会尽快通知您。

Could you please try to use the SET_TWO project instead of using the odeless_531_standalone_set_two.hex image?

So, download the CodeLess project from our web site -DA14585-DA14531无附带条件– and open the Keil project projects\target_apps\codeless\codeless_5xx\Keil_5.

Then please try to enable the Development Debug - #define CFG_DEVELOPMENT_DEBUG in da1458x_config_basic.h – rebuilt the project and run it in debug mode.

After sending the specific I2C, is the project running properly, or it gets stuck into an assertion? ‘

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen:6 months 3 weeks ago
加入:2020-06-25 00:28
I recompiled the SET TWO

根据您的建议,我重新编译了从Keil的来源进行了修复的两个项目。行为中没有任何改变。通过发送读取命令,代码在文件user_i2c.c中粘贴在第89行(等待宏等待_until_no_master_actity()提供的循环)。没有粘在断言。

PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
He Sergei,

He Sergei,

I have escalated internally to the Team, so I’ll get back to you as soon as I have any news on that.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
嗨谢尔盖,

嗨谢尔盖,

Thanks again for your feedback. Please find attached a diff file and perform the suggested modifications in the projects/target_apps/codeless/codeless_5xx/src/user_i2c.c file.

You should set the I2C_STOP bit when the last command is sent to the slave, as shown in the diff file.

The relevant functions should be modified are : user_i2c_read_byte(), user_i2c_read_word16(), user_i2c_write_byte(), user_i2c_write_16(), user_i2c_scan()

在这些更改之后,您是否能够成功执行I2C AT命令?

Thanks, PM_Dialog

Attachment:
PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
嗨谢尔盖,

嗨谢尔盖,

您能否知道建议的修改,请告诉我们解决I2C问题?

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen:6 months 3 weeks ago
加入:2020-06-25 00:28
Dear Dialog Team,

Dear Dialog Team,

sorry I was bisy with other things...

Anyway, I just made code modifications according to your suggestion and recompiled the image.

所有I2C读/写命令现在正常工作。

Thank you very much for your support!

PM_Dialog
Offline
Last seen:11 hours 52 min ago
Staff
加入:2018-02-08 11:03
嗨谢尔盖,

嗨谢尔盖,

谢谢你让我们知道。如果您有任何其他问题,请提出新的论坛帖子。您的反馈将非常欢迎!

Thanks, PM_Dialog