write binfile to device