SPI.setClockDivider() does not work corectly

I am using the intel Galileo board. I notice that no matter what parameter i use for the SPI.setClockDivider(); it does not change the clock rate. why ?

This is the code.

// inslude the SPI library:
#include <SPI.h>


// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;

void setup() 
{
  
  Serial.begin(115200);
  
  // set the slaveSelectPin as an output:
  pinMode (slaveSelectPin, OUTPUT);
  
  SPI.setClockDivider(SPI_CLOCK_DIV128);

  //mode: SPI_MODE0, SPI_MODE1, SPI_MODE2, or SPI_MODE3
  SPI.setDataMode(SPI_MODE0); 
  
  //order: either LSBFIRST or MSBFIRST 
  SPI.setBitOrder(LSBFIRST);
    
  // initialize SPI:
  SPI.begin(); 
}

void loop() 
{
  // take the SS pin low to select the chip:
  digitalWrite(slaveSelectPin,LOW);
  //  send in the address and value via SPI:
  SPI.transfer(0xa5);

  // take the SS pin high to de-select the chip:
  digitalWrite(slaveSelectPin,HIGH); 

  Serial.print("Spi Sent\r\n");
  delay(100);
}

I am using the intel Galileo board. I notice that no matter what parameter i use for the SPI.setClockDivider(); it does not change the clock rate. why ?

How do you know this?
Did you test the SCK with a scope or a logic analyser?

How do you know this?
Did you test the SCK with a scope or a logic analyser?

Yes, from scope, however after posting this i found this out about it.

You cannot set the parameters and then call "SPI.begin();" last. You must call it first and then afterwards you can change the other settings. They should document that.

Where's the Galileo forum? I would have moved this.

CrossRoads:
Where's the Galileo forum? I would have moved this.

I have no idea why arduino has this but yet has not created a forum just for it like the others.