AnsweredAssumed Answered

I2C Addr bit not set on 401 Discover Board

Question asked by chu.hiloshi on Apr 20, 2015
Latest reply on Apr 21, 2015 by chu.hiloshi
Hi All,
Please see below I2C protocal:

I am using STM32F401 Discover Board, the slave is on board CS43L22, the address is 0x94.

I try to send 0x01 to register 0x02: Single_WriteI2C(0x02,0x01), but only send out address, no data phase. I think it cause by slave not ack.
The low level driver is stm32f4xx_hal_i2c.c, if I using old stm32f4xx_i2c.c, the result is OK. So I do not know what is going on.

The complete code as below:
void I2C1_Init()

     GPIO_InitStruct.Pin = GPIO_PIN_6;
     GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;                    //GPIO_MODE_OUTPUT_PP
     GPIO_InitStruct.Pull = GPIO_NOPULL;                         //GPIO_PULLUP
     GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
     GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;               //GPIO_MODE_OUTPUT_PP
     HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

     GPIO_InitStruct.Pin = GPIO_PIN_9;
     HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);


     hi2c1.Instance = I2C1;
     hi2c1.Init.ClockSpeed = 100000;
     hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
     hi2c1.Init.OwnAddress1 = 0xEE;
     hi2c1.Init.AddressingMode  = I2C_ADDRESSINGMODE_7BIT;
     hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLED;
     hi2c1.Init.OwnAddress2     = 0;
     hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLED;
     hi2c1.Init.NoStretchMode   = I2C_NOSTRETCH_DISABLED;
void Single_WriteI2C(uint8_t REG_Address,uint8_t REG_data)
    uint8_t TxData[2] = {REG_Address,REG_data};
    HAL_StatusTypeDef i;
    uint8_t j=0;


main(int argc, char* argv[])

     while (1)

Hope someone could help me solve this issue, thanks all.