I presume you already checked the loopback connections:
- mosi output from master connected to mosi input pin to slave
- miso output from slave connected to miso input to master
- sclk from master feeds sclk slave input
- slave select output from master drives ss input pin on slave
What's your master sclk frequency? Can you test the mosi signal?
Also check the status and control register on both master and slave, both before and after the execution of the above code. If you don't find anything wrong, post their values and I'll take a look.
For similar spi example, you can also refer to the alt_avalon_spi_command() function in HAL driver library.