stm32f1x: Fix byte order bug and remove unnecessary cast