sm501: Convert debug printfs to traces