Memory programming and device debugging