Posted on January 06, 2018 at 00:03The original post was too long to process during our migration. Please click on the attachment to read the original post.
The HAL_I2C_Master_Transmit() function is expecting it's third argument to be a pointer to the data buffer you want to send. So you should have something like &(buffer[2]) instead of buffer[2].
I would recommend that you have a look a the Cube
I2C/I2C_TwoBoards_ComPolling/Src/main.c example located inside your Cube library.