HAL_I2C_mem_read_dma return error
I'm connecting to a nucleo144 through configured pins and i2c connection a melexis 90640 (thermal scanner) I initially tried through Hal functions to call the device on the default address I had from the datasheet (0x33) but did not find it so I solved by doing a for from 1 to 128 to find the address once returned HAL_Ok by the function I try to read the data with the function HAL_Mem_Read_DMA but returns error. place below the code. What could be the problem?
//funzione I2C per vedere l'indirizzo a cui è attaccato per poi procedere alla ricezione dei dati
for(i=0;i<128;i++){
err_I2C = HAL_I2C_IsDeviceReady(&hi2c1,(uint8_t)(i<<1), 3, 10);
if (err_I2C== HAL_OK){
printf("is ready");
while (HAL_I2C_GetState(&hi2c1) != HAL_I2C_STATE_READY)
{
}
if(HAL_I2C_Mem_Read_DMA(&hi2c1,(uint8_t)(i<<1), MEM_ADDRESS, I2C_MEMADD_SIZE_8BIT, data, 192)!=HAL_OK){
Error_Handler();
}
while (HAL_I2C_GetState(&hi2c1) != HAL_I2C_STATE_READY)
{
}
}
}