The Compact Muon Solenoid Experiment (CMS) is operating at the Large Hadron Collider (LHC) with proton-proton
collisions at 13 TeV center-of-mass energy and at a bunch spacing of 25 ns.
New further challenging running conditions for CMS are expected after the High-Luminosity
upgrade of the LHC (HL--LHC). The CMS electromagnetic calorimeter (ECAL) will be upgraded to sustain the hardened environment.
The design and R\&D studies for the ECAL upgrade are presented
together with first test--beam studies. Particular challenges at HL--LHC are the harsh radiation environment,
the increasing data rates and the extreme level of pile-up events, with up to 200 simultaneous proton-proton collisions.
Precision timing can be exploited to reduce the effect of the pile-up. Time resolution measurements
carried out during test beams are shown. Plans are also shown for R\&D for the new readout and trigger electronics,
which must be upgraded due to the increased trigger and latency requirements at the HL--LHC