Add comments and tiny improvements to STM32 flash loader algorithm