write-flash function working...

Got basic write-firmware file to flash function completed &
communicating with device.
Write-flash not working somewhere

Doesn't work because device doesn't get upgraded….. added a
re-initialize device function.