stm32: add error propagation on writes