BMC150 initialization does not work

I am trying to read ID register of BMC150 using SPI. I am using stm32f103 microcontroller. Serial clock line is OK and the data is sent properly over MOSI of microcontroller. But no response is sent back through MISO. I have checked signals using oscilloscope. Here is a part of my C code. How can I resolve this issue? Thanks.

    while(1){
//Activate Slave
SPI_GPIO->BRR = SPI_PIN_SS;
// Go to active power mode
SPI_I2S_SendData(SPIx, 0x4B01);
while (!(SPIx->SR & (SPI_I2S_FLAG_TXE)));
// delay for applying setting stably
delay_ms(1);
// Go to normal mode
SPI_I2S_SendData(SPIx, 0x4C00);
while (!(SPIx->SR & (SPI_I2S_FLAG_TXE)));
delay_ms(1);
SPI_I2S_SendData(SPIx, 0xC000);
while (!(SPIx->SR & (SPI_I2S_FLAG_RXNE)));
while (SPIx->SR & (SPI_I2S_FLAG_BSY));
}

• Is the CS pin low? – Turbo J Aug 24 '18 at 13:37
• Did you measure this with the scope or a multimeter? That line says nothing since we don't see the value of SPI_PIN_SS. There is a really good chance this line does not do what you think it does. – Turbo J Aug 24 '18 at 17:40
• Dear @TurboJ , You are right, I wil check it again. Thanks. – Mr. Nobody Aug 24 '18 at 21:30

I solved the problem by activating and deactivating slave (using chip or slave select pin) before and after writing process as follows:

while(1){
//Activate Slave
SPI_GPIO->BRR = SPI_PIN_SS;
// Go to active power mode
SPI_I2S_SendData(SPIx, 0x4B01);
while (!(SPIx->SR & (SPI_I2S_FLAG_TXE)));
SPI_GPIO->BSRR = SPI_PIN_SS;
// delay for applying setting stably
delay_ms(1);
SPI_GPIO->BRR = SPI_PIN_SS;
// Go to normal mode
SPI_I2S_SendData(SPIx, 0x4C00);
while (!(SPIx->SR & (SPI_I2S_FLAG_TXE)));
SPI_GPIO->BSRR = SPI_PIN_SS;
delay_ms(1);