As it was shown by Tian and Styan, equality in the Frobenius rank inequality holds if and only if there exist matrices $X$ and $Y$ (of appropriate sizes) such that $$ BCX+YAB=B. $$In the special case $A=B=C$ this means, that in the Frobenius inequality $rk(A^3)\ge 2rk(A^2)-rk(A)$ we have equality if and only if there exist $X$ and $Y$ such that $A^2X+YA^2=A$. This holds if $A^k=A$ for some $k>1$.