Let $$F_{\infty }={{\mathbb {F}}_q}\left( \!\left( {1/T}\right) \!\right) $$ be the completion of $${\mathbb {F}}_q(T)$$ at 1/T. We develop a theory of Fourier expansions for harmonic cochains on the edges of the Bruhat–Tits building of $${{\,\textrm{PGL}\,}}_r(F_{\infty })$$ , $$r\ge 2$$ , generalizing an earlier construction of Gekeler for $$r=2$$ . We then apply this theory to study modular units on the Drinfeld symmetric space $$\Omega ^r$$ over $$F_{\infty }$$ , and the cuspidal divisor groups of Satake compactifications of certain Drinfeld modular varieties. In particular, we obtain a higher dimensional analogue of a result of Ogg for classical modular curves $$X_0(p)$$ of prime level.