Characterization of a CMOS pixel sensor for charged particle tracking