The formation mechanism and thermal stability of CaCrO4