How to write log file to external SD-Card

I am sorry this is an old thread. But I am stuck at the same place. I am using APM 2.6 and I want to log my data onto a external sd card that I am trying to attach via the sparkfun sd shield ( So can I connect the sd card shield via the SPI of APM 2.6?? I connected the shield to an arduino mega 2560 and it worked fine. But it seems unresponsive to the APM 2.6. Can anyone please help!!!