If $A$ is a stable basis algebra of rank $n$, then the set $S_{n-1}$ of endomorphisms of rank at most $n-1$ is a subsemigroup of the endomorphism monoid of $A$. This paper gives a number of necessary and sufficient conditions for $S_{n-1}$ to be generated by idempotents. These conditions are satisfied by finitely generated free modules over Euclidean domains and by free left $T$-sets of finite rank, where $T$ is cancellative monoid in which every finitely generated left ideal is principal.