  HM Lup is a young M-type star that accretes material from a circumstellar
disk through a magnetosphere. Our aim is to study the inner disk structure of
HM Lup and to characterize its variability. We used spectroscopic data from
HST/STIS, X-Shooter, and ESPRESSO taken in the framework of the ULLYSES and
PENELLOPE programs, together with photometric data from TESS and AAVSO. The
2021 TESS light curve shows variability typical for young stellar objects of
the "accretion burster" type. The spectra cover the temporal evolution of the
main burst in the 2021 TESS light curve. We compared the strength and
morphology of emission lines from different species and ionization stages. We
determined the mass accretion rate from selected emission lines and from the UV
continuum excess emission at different epochs, and we examined its relation to
the photometric light curves. The emission lines in the optical spectrum of HM
Lup delineate a temperature stratification along the accretion flow. While the
wings of the H I and He I lines originate near the star, the lines of species
such as Na I, Mg I, Ca I, Ca II, Fe I, and Fe II are formed in an outer and
colder region. The shape and periodicity of the 2019 and 2021 TESS light
curves, when qualitatively compared to predictions from magnetohydrodynamic
models, suggest that HM Lup was in a regime of unstable ordered accretion
during the 2021 TESS observation due to an increase in the accretion rate.
Although HM Lup is not an extreme accretor, it shows enhanced emission in the
metallic species during this high accretion state that is produced by a density
enhancement in the outer part of the accretion flow.
