Now use same write to pipe code as used before for bootloading.