Codeless I2C does not work properly on DA14531 TINY module

Learn MoreFAQsTutorials

11 posts / 0 new
Last post
Sergei Bezroukov
Offline
Last seen:4 months 2 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.

I also tried other sensors and combinations of 1- and 2-byte registers. Nothing works as expected.

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

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

Hi Sergei Bezroukov,

Thanks for your follow up question and for your feedback. Let me check it and I’ll get back to you.

Thanks, PM_Dialog

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

Hi Sergei Bezroukov,

Apologies for the delay. So, if I understood currently, this can be replicated after ~3minutes, is that right? May I ask if the module is connected with a peer device, or it just advertises?

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:4 months 2 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:5 hours 5 min ago
Staff
加入:2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

Many thanks for your extra inputs. I will escalate this behavior internally to the Team and I’ll let you know as soon as possible.

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 Codeless AT Command– 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:4 months 2 weeks ago
加入:2020-06-25 00:28
I recompiled the SET TWO

I recompiled the SET TWO project from source on Keil according to your suggestions. Nothing changed in the behavior. By sending the READ command the code is stuck on line 89 in file user_i2c.c (waiting while-loop provided by macro WAIT_UNTIL_NO_MASTER_ACTIVITY()). No stuck into an assertion.

PM_Dialog
Offline
Last seen:5 hours 5 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:5 hours 5 min ago
Staff
加入:2018-02-08 11:03
Hi Sergei,

Hi Sergei,

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()

After those changes, are you able to execute the I2C AT commands successfully?

Thanks, PM_Dialog

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

Hi Sergei,

Could you please let us know fi the suggested modifications solve the I2C issue?

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen:4 months 2 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.

All I2C read/write commands work fine now.

Thank you very much for your support!

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

Hi Sergei,

谢谢你让我们知道。如果你有任何其他问题tion, please raise a new forum post. Your feedback would be more than welcome!

Thanks, PM_Dialog