Development of hard X-ray spectrometer with full digital data acquisition for runaway electron studies at HL-2M