Add flash writing

Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>