Setting up SPI on STM32F030C8
Common problem on STM32:

RCC_APB1PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);
-------^----------------------^-


There could well be more typos, that was probably only the first one.