Updated serial bug.
Moved flash opertaions to ram section