use HAL as much as possible in stop mode code