In hypersonic flight, the flow separation and aerodynamic heating induced by shock wave turbulent boundary layer interaction (STBLI) pose a severe threat to the aircraft safety. Based on the verified direct numerical simulation, this paper investigates STBLI generated by 25 degrees-35 degrees compression ramps for cold walls at Ma of 5, with the focus on the coupling effect of the flow separation and aerodynamic heating. On the one hand, the results show that as the shock intensity increases, the flow field turns from a small separation into a large separation. However, compared with adiabatic walls, cold walls reduce separation scales, resulting in the separation state differences. This paper proposes a wall temperature-corrected Mach number Ma* to predict separation types of STBLI for nonadiabatic walls, and the results prove that Ma* is accurate. On the other hand, this paper discovers the sharp heat flux peak for the small separation and the local heat flux drop in the recirculation region for the large separation and reveals the similarities and differences in the aerodynamic heating mechanisms. For small separations, the sharp heat flux peak is caused by the sharp turbulent dissipation peak, while for all cases, the wide heat flux peaks downstream are caused by the combination of turbulent and mean dissipation peaks, along with continuous compression heating. The heat flux valleys near the separation points are all due to the outward transport of aerodynamic heat, while the heat flux valleys in the large-scale separation are attributed to the weak turbulence at the recirculation center.