Question
cannot send a message from a slave to a master i2c stm32f103!!
Posted on January 22, 2018 at 10:06
hello trying to send a message from an stm32 slave to another stm32 master no success i2c protocol ,
from master to slave no prblm i can do it very well ,
i cheked many times the repository interrupt exemples and did like them but no any changing, here what i did
slave part :
if(HAL_GPIO_ReadPin(GPIOA, BUTTON_Pin)==1)//USER BUTTON PUSHED
{//BUTTON printf('BUTTON'); while(HAL_GPIO_ReadPin(GPIOA, BUTTON_Pin)==1) //wait button to be released if(HAL_I2C_Slave_Transmit(&hi2c2,data_master,1,50)==HAL_OK)//slaves answer to master {// printf('slave send to master succeed'); while (HAL_I2C_GetState(&hi2c2) != HAL_I2C_STATE_READY) { } // }}//BUTTONthis function always fails, can you advice me plz