Left: Charm-quark fragmentation fractions into charm hadrons measured in pp collisions at $\s = 5.02 \TeV$ in comparison with experimental measurements performed in \ee{} collisions at LEP and at B factories, and in ep collisions at HERA . The \Dstar{} meson is depicted separately since its contribution is also included in the ground-state charm mesons. Right: Charm production cross section at midrapidity per unit of rapidity as a function of the collision energy. STAR and PHENIX results, slightly displaced in the horizontal direction for better visibility, are reported. Comparisons with FONLL (red band) and NNLO (violet band) pQCD calculations are also shown.