This paper presents the construction of a electronic system for two-dimensional hard X-ray spectroscopic imaging using CZT(Cadmium Zinc Telluride, CdZnTe) detector on EAST(Experimental Advanced Superconducting Tokamak), designed to measure the spatiotemporal distribution evolution of fast electrons in the energy range of 20 keV-700 keV. The system primarily consists of a two-dimensional array of CZT detector, an observation window, shielding components, front-end electronics system, and a data acquisition system. The two-dimensional array of detector is installed on the horizontal D window of EAST, with an observation range covering the plasma core region. The system achieves a temporal resolution of 2–16 ms and a spatial resolution of 10 cm. Data processing is carried out using FPGA-based (Field Programmable Gate Array) spectral recognition algorithms. Prior to the experiments on EAST, spectrum calibration is conducted using radioactive sources Eu152, Cs137, and Am251. In the 2023 EAST experiments, the system successfully measured the behavior of fast electrons generated under low hybrid discharge conditions, enabling spectrum measurements at different spatial locations within the plasma. Finally, the experimental results show that the system has a good performance.