Improved freertos and stm32lib scripts