Sounds like one of the pawls in the freehub has broken off or a spring has popped out from under it, if the grease has dried up it will rattle about.
Fortunately the freehub body is replacable in the majority of cases, at least you caught it now because the others will get over stressed and break as well over time, leaving you with no drive, which is not a good thing miles from home.