The SS PIN does not toggle at all while doing SPI. How shall I solve this?
That's weird, I just tested it and trying to change any pin with the same lines you added:
I was able to toggle the pins or set them to high or low. The same results with SS Pin, I was able to see it toggling with an Arduino sketch. Maybe this is related to the Arduino IDE you are using, which version are you using?
To toggle a pin High or Low I had to add the system call system("echo 42 > /sys/class/gpio/export"); for the respective GPIO pin.I would suggest you to add the 3 lines of code in SPI.cpp in SPI.begin function and see if the pin is toggling or not that too pins other than 13 (which is linked to the LED). I am using Arduino IDE 1.6.4.
Solved. Works with 1.6.5 arduino.