  We define and study the subspace of cuspidal functions for $G$-bundles on a
class of nilpotent extensions $C$ of curves over a finite field. We show that
this subspace is preserved by the action of a certain noncommutative Hecke
algebra $\mathcal{H}_{G,C}$. In the case $G=\rm{GL}_2$, we construct a
commutative subalgebra in $\mathcal{H}_{G,C}$ of Hecke operators associated
with simple divisors.
  In the case of length 2 extensions and of $G=\rm{GL}_2$, we prove that the
space of cuspidal functions (for bundles with a fixed determinant) is
finite-dimensional and provide bounds on its dimension. In this case we also
construct some Hecke eigenfunctions using the relation to Higgs bundles over
the corresponding reduced curve.
