RepRapFirmware is built from several Github projects. You need to use compatible branches of these projects. Since RepRapFirmware v3.1.0, stable releases are tagged in github.