Raspberry require wiringPiSPI library http://wiringpi.com/reference/spi-library/ Use the same path for compile stm32f4 with keil project is really important.