Refactored system call wrappers for Cortex-M