A method for diagnosing the function of at least one accumulator (112, 208, 224) in a hydraulic circuit in percussive rock drilling, the hydraulic circuit providing pressurised hydraulic fluid to power a percussion device comprising a reciprocating percussion piston for generating stress waves in a drill tool and/or a damping piston, wherein the reciprocating motion of the percussion piston and/or a damping piston gives rise to pressure and flow variations in the hydraulic circuit; and the at least one accumulator (112, 208, 224) is configured to reduce pressure and/or flow variations in the hydraulic circuit; the method further comprising, during drilling: obtaining a plurality of pressure measurements during a first period of time, wherein the plurality of pressure measurements are obtained at a frequency being at least twice a frequency of the reciprocating motion of the percussion piston and/or damping piston; determining a representation of pressure and/or flow variations in the hydraulic circuit caused by the reciprocating motion of the percussion piston and/or damping piston during the first period of time; diagnosing the function of the at least one accumulator (112, 208, 224) based on the determined representation of the pressure and/or flow variations in the hydraulic circuit and a reference representation of pressure and/or flow variations in the hydraulic circuit, wherein the diagnosing comprises comparing the determined representation of pressure and/or flow variations in the hydraulic circuit with the reference representation of pressure and/or flow variations in the hydraulic circuit; and generating a signal indicating a fault when the determined representation of pressure and/or flow variations in the hydraulic circuit deviates from the reference representation of pressure and/or flow variations by a predetermined difference, indicating improper function of the at least one accumulator (112, 208, 224). obtaining a plurality of pressure measurements during a first period of time, wherein the plurality of pressure measurements are obtained at a frequency being at least twice a frequency of the reciprocating motion of the percussion piston and/or damping piston; determining a representation of pressure and/or flow variations in the hydraulic circuit caused by the reciprocating motion of the percussion piston and/or damping piston during the first period of time; diagnosing the function of the at least one accumulator (112, 208, 224) based on the determined representation of the pressure and/or flow variations in the hydraulic circuit and a reference representation of pressure and/or flow variations in the hydraulic circuit, wherein the diagnosing comprises comparing the determined representation of pressure and/or flow variations in the hydraulic circuit with the reference representation of pressure and/or flow variations in the hydraulic circuit; and generating a signal indicating a fault when the determined representation of pressure and/or flow variations in the hydraulic circuit deviates from the reference representation of pressure and/or flow variations by a predetermined difference, indicating improper function of the at least one accumulator (112, 208, 224).