Direct imaging of Earth-like planets from space requires dedicated observatories, combining large segmented apertures with instruments and techniques such as coronagraphs, wavefront sensors, and wavefront control in order to reach the high contrast of 10^10 that is required. The complexity of these systems would be increased by the segmentation of the primary mirror, which allows for the larger diameters necessary to image Earth-like planets but also introduces specific patterns in the image due to the pupil shape and segmentation and making high-contrast imaging more challenging. Among these defects, the phasing errors of the primary mirror are a strong limitation to the performance. In this paper, we focus on the wavefront sensing of segment phasing errors for a high-contrast system, using the COronagraphic Focal plane wave-Front Estimation for Exoplanet detection (COFFEE) technique. We implemented and tested COFFEE on the High-contrast imaging for Complex Aperture Telescopes (HiCAT) testbed, in a configuration without any coronagraph and with a classical Lyot coronagraph, to reconstruct errors applied on a 37 segment mirror. We analysed the quality and limitations of the reconstructions. We demonstrate that COFFEE is able to estimate correctly the phasing errors of a segmented telescope for piston, tip, and tilt aberrations of typically 100nm RMS. We also identified the limitations of COFFEE for the reconstruction of low-order wavefront modes, which are highly filtered by the coronagraph. This is illustrated using two focal plane mask sizes on HiCAT. We discuss possible solutions, both in the hardware system and in the COFFEE optimizer, to mitigate these issues.