The advent of back-illuminated complementary metal-oxide-semiconductor (CMOS) sensors and their well-known advantages over charge-coupled devices make them an attractive technology for future X-ray missions. However, numerous challenges remain, including improving their depletion depth and identifying effective methods to calculate per-pixel gain conversion. We have tested a commercial Sony IMX290LLR CMOS sensor under X-ray light using an Fe55 radioactive source and collected X-ray photons for similar to 15 consecutive days under stable conditions at regulated temperatures of 21 degrees C and 26 degrees C. At each temperature, the data set contained enough X-ray photons to produce one spectrum per pixel consisting only of single-pixel events. We determined the gain dispersion of its 2.1 million pixels using the peak fitting and the energy calibration via correlation (ECC) methods. We measured a gain dispersion of 0.4% at both temperatures and demonstrated the advantage of the ECC method in the case of spectra with low statistics. The energy resolution at 5.9 keV after the per-pixel gain correction is improved by greater than or similar to 10 eV for single-pixel and all event spectra, with single-pixel event energy resolution reaching 123.6 +/- 0.2 eV, close to the Fano limit of silicon sensors at room temperature. Finally, our long data acquisition demonstrated the excellent stability of the detector over more than 30 days under a flux of 10(4) photons per second.