Boundary value problems for Bagley--Torvik fractional differential equations at resonance