DJI’s ‘Selfie Drone,’ the DJI Spark, is a drone produced and released by DJI in May 2017. It is primarily used for taking photos and videos. A physical controller for the DJI Spark can also be purchased separately from the DJI Spark, or in a package with the DJI Spark called the ‘Fly More Combo.’
I had to exact same issue with my IMU your best bet is to get the compass replaced they are not very expensive. If there is a internal problem with the compass module the safety systems will not let it take off after a couple of flights.