add flash read and write