Skip to main content
Ypvt .1
Visitor II
May 24, 2022
Solved

I2C read is not working in latest spc5 studio 6.0, but the same code works in the old version spc5 studio. I don't know what to do.

  • May 24, 2022
  • 7 replies
  • 5929 views

Hello I'm sharan from yali mobilities. Here we are shifting from old spc5 studio to latest version spc5 studio 6.0. For testing I2C, I have used Arduino as a slave device. The programme which I have writen is attached as image. Arduino sends a inter value when an request event is occured. The programme runs in old spc5 studio, but it's not working in spc5 studio 6.0. I have used same configurations, setups and same board.

I have tried I2C write function it works properly for all the devices, which I have tested. If any one knows the solution kindly reply.

Thank you for reading.

0693W00000NqYnDQAV.png

This topic has been closed for replies.
Best answer by ODOUV.1

Hello,

would you please try with this fixed file and let us know ?

====patch====

@@ -619,8 +619,12 @@ static int i2c_hw_read(void *priv, uint8_t dev_addr, uint16_t reg_addr, uint8_t

  i2cd->i2c_tagp->IBCR.B.RSTA = 0x1;

  i2cd->i2c_tagp->IBCR.B.IIC_MS = (uint8_t)i2cd->mode;

  i2cd->i2c_tagp->IBCR.B.IIC_TX = 0x1;

- i2cd->i2c_tagp->IBDR.R = i2cd->dev_addr| I2C_HW_READ;

- i2cd->state = I2C_MASTER_READ_DUMMY_DATA;

+ if (reg_addr_size == I2C_16_BIT_REG_ADDRESS) {

+ i2cd->i2c_tagp->IBDR.R = i2cd->dev_addr;

+ } else {

+ i2cd->i2c_tagp->IBDR.R = i2cd->dev_addr| I2C_HW_READ;

+ i2cd->state = I2C_MASTER_READ_DUMMY_DATA;

+ }

  } else {

  /* In slave mode it reads until no data on the I2C bus */

  i2cd->i2c_tagp->IBAD.R = dev_addr;

=============

-Best regards,

-Olivier

7 replies

Erwan YVIN
ST Employee
May 24, 2022

Hello Sharan ,

Could you send me your installation details ?

I need the version of SPC5RLA used for your device

You can revert the drivers installation from 1.17.0 to 1.16.0 , 1.14.0.

0693W00000NqZ4JQAV.png Best Regards

Erwan

Yali Mobilities
Associate III
May 25, 2022

Could you tell me please, where can I find these details and I'm having SPC58EC80 disp board. Thank you

Yali Mobilities
Associate III
May 25, 2022

Could you tell me please, where can I find these details and I'm having SPC58EC80 disp board. Thank you

ODOUV.1
ST Employee
June 1, 2022

go to Menu Help-> About SPC5Studio

click on Installation Details

use Filter SPC58EC

0693W00000Nr0VMQAZ.png

Yali Mobilities
Associate III
June 2, 2022

Here I've attached the image. I checked for the update and it's upto date. Kindly look into it. Thank you.

0693W00000Nr58XQAR.png

ODOUV.1
ODOUV.1Best answer
ST Employee
June 2, 2022

Hello,

would you please try with this fixed file and let us know ?

====patch====

@@ -619,8 +619,12 @@ static int i2c_hw_read(void *priv, uint8_t dev_addr, uint16_t reg_addr, uint8_t

  i2cd->i2c_tagp->IBCR.B.RSTA = 0x1;

  i2cd->i2c_tagp->IBCR.B.IIC_MS = (uint8_t)i2cd->mode;

  i2cd->i2c_tagp->IBCR.B.IIC_TX = 0x1;

- i2cd->i2c_tagp->IBDR.R = i2cd->dev_addr| I2C_HW_READ;

- i2cd->state = I2C_MASTER_READ_DUMMY_DATA;

+ if (reg_addr_size == I2C_16_BIT_REG_ADDRESS) {

+ i2cd->i2c_tagp->IBDR.R = i2cd->dev_addr;

+ } else {

+ i2cd->i2c_tagp->IBDR.R = i2cd->dev_addr| I2C_HW_READ;

+ i2cd->state = I2C_MASTER_READ_DUMMY_DATA;

+ }

  } else {

  /* In slave mode it reads until no data on the I2C bus */

  i2cd->i2c_tagp->IBAD.R = dev_addr;

=============

-Best regards,

-Olivier

Yali Mobilities
Associate III
June 9, 2022

I have replaced those two lines with these condition lines. But it doesn't work. The result as I2C_ERROR_BUS_BUSY.

ODOUV.1
ST Employee
June 9, 2022

Hello,

would you please provide your structure:0693W00000NrVPeQAN.png

-Best regards

Olivier

Yali Mobilities
Associate III
June 11, 2022

Kindly look into it.

0693W00000NreyYQAR.png

ODOUV.1
ST Employee
June 13, 2022

Hello,

R&D found a regression on I2C HW, we will come back to you as soon as the fix is ready.

Best regards,

-Olivier

Yali Mobilities
Associate III
July 13, 2022

Is there any update regarding the I2C driver?

ODOUV.1
ST Employee
August 2, 2022

Hello,

I asked to R&D but I had no news yet.

I may not have an answer until the end of august.

Best Regards