External power using Vin when USB is used to upload firmware

I have UNO rev4 WiFi with a low power stepper connected via A4988 and look for a best powering option to use a single power source. Although I've read a lot related to this, there is no direct answer to the following dilemma I have between the two options:

Option1: to power Arduino using external 9V supply connected to the barrel jack and use Vin connector from UNO to power A4988 Vmot.
Option 2: to use external LM2596 step down module to supply 9V to it and to A4988 Vmot in parallel; 5V output from LM is to be connected to UNO 5V terminal (VIn may not be used as 5V will be too low for VIn according to Arduino manual).

The concern I have is related to the use of USB when I need to upload a new firmware to UNO. And the concern is valid in both options:
Option 1: when I connect USB (assume barrel jack is not plugged) I will have 5V from USB on VIn and on Vmot correspondingly, according to Arduino manual. Although A4998 claims to automatically stop working because of Vmot underpower, there is no clarity it will be disabled/disconnected. Do I have a risk to burn my USB port with a high current? Will occasional rotation of the stepper result in a back current to USB?

Option 2: when I connect USB I will have 5V from USB on 5V which will go to LM2596, and according to its instructions it is not protected from back power. Moreover, there is theoretically a risk that 9V power supply will not be disconnected from LM which will result in cross powering between UNO and LM.

The question: is the concern valid in both options, and if yes - what should I do to prevent an issue? And which of the two options is better?

I have not seen any USB-A/USB-B/USB-C cable that has only three active wires (D+, D-, and GND). If such cable exists, then you can upload sketch from PC and power the Arduino UNO R3 from external 7V-12V supply using Vin-pin.

I see nothing in the documentation that says it's safe to use Vin as an output or the 5V pin as an input

It seems the documentation says just the opposite, 5V is an output and Vin is an input.

I also see a Warning about connecting high current devices to the 5V output.

Option 3 (the safe way):
Connect 9V power to R4 Vin and to A4988 Vmot with the recommended 100uF capacitor.
Connect R4 5V output to A4988 Vdd
Connect all grounds.

Hmm, I read it so many times that was hundred percent sure it is an option suggested by Arduino to be used with care. But you're right - a lot of people are using it, but I could not find anything official from Arduino. This means actually there is no way of supplying external 5V other than via USB and actually via the USB socket? As to the VIn terminal, I was sure it is a direct connector to barrel plus, isn't it? Arduino forum says this connector will receive power when USB is connected.

Thank you for clarification, jim-p. Your Option 3 is actually the Option 1 in my list, I just use not VIn connector, but the external power barrel jack, which should be the same - or I am mistaken? Regarding the capacitor: I have a standard expansion board for the stepper driver which has a 100 µF capacitor on it - do you think it will work? The link: Youmile 3D Printer Stepper Motor Driver Control Extension Shield Board with A4988 DRV8825 DuPont Cable, for A4988 DRV8825 Printer Accessories : Amazon.de: Garden

You can look into the schematic of UNO R3 (Fig-1) how USBVCC (USB5V). Vin, +5V, 3.3V, and barrel connector (X1) points are related:


Figure-1:

No you are right they are the same, however they are both inputs but only one can be used at a time.

Looks like your little motor shield board has the 100uF so I guess you are ready to go.

normaly the usb connection already power the arduino when updating, what u can do is connect.
if the use can't be used as the power source
you could be able to use the Vin and the gnd to connect any battries from 7V - 12V (recommanded) and 22v MAX
as the rev 4 already as a converter

I do not have this unit but when using an external power supply I remove the B+ from the usb cable. On my cables that has been the red wire. I also have a cheep china hub that switches for the power on each USB. When checking it out I found it simply removes the 5V so I use that. Note the grounds are all connected and d+ and D- are referenced to ground.

As per following partial schematic of UNO R3, the USB power (USBVCC) would be automatically isolated via T1 when external supply/power (7V - 12V) is applied at Vin-pin or the barrel connector (X1).

On the R3, nano and few others that is correct but the schematic for the R3 and R4 is different. I found this at: Arduino UNO R4 WiFi Pinout Reference

Here is another reference: Arduino UNO R4 WiFi, ABX00087 Manual | ManualsLib

In this case either solution will work.

Thanks to everybody. Summing up:
Option with the external power supply is not required, moreover it would force to use 5V pin as input which in general is not recommended by Arduino.
So, only the option with the external 9V supplied to barrel jack is valid for powering Arduino with a stepper motor using a single power source. The only thing I did not understand completely: is it right to supply external power to the barrel jack and to the stepper controller from VIn connector? Or to the external plug and from it to VIn and Vmoto (without the use of barrel jack)? Or it is the same?

Sorry! OP is using UNO R4 WiFi.

This is great, thank you! On forums I met several places where the Power Jack is connecter to the regulator via diode, while VIn directly. The diagram is great and this thread will serve a lot to explain the matter to everybody.

Vin stands for Voltage Input so what do you think?

Why not be safe and just do things the right way!

On the UNO R3 board, the labeling is Vin; whereas, in the schematic of UNO R3, the signal symbol is VIN. Is this a flaw in the technical documentation?

I understand your logic. If you look at the diagram above and VIn connector is physically connected to the power socket the purpose of the connector stops making sense: if you want to make VIn a real input, you need to physically design a place on your device for an additional power socket, just to keep the logic solid. In addition to extra construction, it will mean two similar power sockets on your device and a confusion which one is to be used. This is how I think, but only if the diagram is showing the case.

Why?
You can power the board either by the Vin pin or the barrel jack.
There are some shields that supply power to the R4 board via the Vin pin.

Like I said what will it cost you to just do it the right way?

It will cost me an additional power plug that I will have to add to my project, unless I miss something. I need a plug to connect the external power supply to. If the UNO barrel jacket may not be used - another one is to be added, or the one on the shield but an additional one.

If you mean barrel jack, you don't need any.
Cut the jack off of the 9V adaptor and splice two sets of wires to the cable, one for Vin and one for Vmot.