cortex_m: avoid reading and writing non-existent registers