An asymptotic analysis of the Gunn effect (oscillations of the current through a semiconductor under constant voltage bias) is given. The electric field inside the one-dimensional semiconductor is described by a parabolic equation with small diffusivity, plus zero-field boundary conditions and a constant-voltage integral constraint. Nonuniform stationary solutions are constructed and their stability analyzed under both current and voltage bias. The oscillations are known to be produced by repeated generation at one boundary of a solitary wave that moves towards and is annihilated at the other boundary. Far from the boundaries the solitary wave is constructed and its stability analyzed. The effect of the boundaries is qualitatively discussed and several open problems pointed out.