A weakly nonlinear analysis of sand banks dynamics