Renesas Synergy fail to change I2C address

i have 2 I2C peripherals and i am sharing the I2C on SCI

while i am able to read from the I2C device with address 0x20, subsequently when i attempt to change to another peripheral at 0x28 via code below it fail. the slave address remains at 0x20


err = g_i2c_groveA.p_api->slaveAddressSet(g_i2c_groveA.p_ctrl,slave,I2C_ADDR_MODE_7BIT);
err = g_i2c_groveA.p_api->open(g_i2c_groveA.p_ctrl, g_i2c_groveA.p_cfg);
SSP_ERROR_LOG(err,"open MCP23008 in STOP cycle",202)

  • Hi Weiwei2-
    Have you tried opening the module first and THEN changing the slave address?
  • In reply to WarrenM:

    ok, i try that and although the slave address (as i check by breakpoint and checking the p_cfg.slave) doesn't seems change, but it successfully selected my 0x28 I2C peripheral. not sure why the slave address doesn't seems change but it is able to work now. Thanks
  • In reply to weiwei2:

    The p_cfg structure will not be changed, it is only used during the open() function and is constant. The p_ctrl structure will contain the runtime I2C address.