Take a look at threads like
(take into acount that gpio numbering of Intel Galileo Gen2 is not the same as that of Intel Galileo)
I am doing the same assignment and facing the same issue. I also tried with gpio7 pin. But it is not working.
If you can kindly suggest anything please let me know.Also, if you need 3.3 v voltage for I/O pins then how will you connect IOREF pin to 3.3 v pin?Had you done any such connection?