Fixed bugs with SPI FLASH