Characterization of some minimal codes for secret sharing