I am still quite new and learning the AVR world. If this question is silly or not obvious please excuse me: I am still a beginner.

Is the following possible?

Imagine two Arduino Uno's that talk to each other via the on-board Serial pins (ATMega328P-PU chips). They "talk" via RX/TX pins at 9600 baud. They have a common ground wire also. So all is well so far: they send and receive character strings no problem. Lets call them "A" and "B".

I can easily re-program "A" with out any change to my set up by popping out the 328P-PU chip, updating it and popping it back in "A"

Is there anyway for "A" to reprogram "B" directly? I already have a "boot burner" set up where one Uno can be used to burn a boot loader to another Uno that does not have it. Why I am asking is can one Uno directly re-program a connected Uno? So if "A" has version 1.3 it in ROM, it can force "B" to have 1.3 as well and re-boot it.

"B" might be buried deep in the bowels of some mechanical project, where it is a PITA to get to: so any software corrections / revisions are a pain in the butt to implement.

Thank you for any and all help / insight.

Sam

I am a new AVR programmer. I am learning alone out of books, the Internet, etc. Please excuse me if I ask simple questions. Thanks.

More specifically: In the Arduino world, my Windows desk top used 4 wires (Vcc, GND, Rx and Tx) in a USB cable to tell my Uno it is getting a program update and to update it. I am asking how can i set up "A" to use those same 4 wires to do the same task?

I am a new AVR programmer. I am learning alone out of books, the Internet, etc. Please excuse me if I ask simple questions. Thanks.

So if "A" is running one kind of hello world / blink program, I can transfer it to "B" and then they both are running it?

Do I understand what you wrote correctly?

Thank you!

No. "A" will be running firmware specifically to act as a programmer.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

More specifically: In the Arduino world, my Windows desk top used 4 wires (Vcc, GND, Rx and Tx) in a USB cable to tell my Uno it is getting a program update and to update it. I am asking how can i set up "A" to use those same 4 wires to do the same task?

You can't. Your PC is a USB host. An Uno has no provisions to be a USBhost.

You seem to be in deeper waters than you can currently swim in. Take a step back and tell us what you actually want to accomplish.

If this is simply about having two Unos running the same sketch then why not simply program both Unos with the same sketch from your PC?
EDIT: Spelign misteaks.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

I am working on a project, really an idea right now: no prototype yet. One Uno will be some what easy to reach, the other one deep in the bowels of a machine I have an idea for. Just an idea right now.

I am a new AVR programmer. I am learning alone out of books, the Internet, etc. Please excuse me if I ask simple questions. Thanks.

In principle, there is nothing stopping you from having "A" be both an ISP programmer (programming "B") AND running HelloWorld. You'll have to take the ArduinoISP sketch sources and adapt it to add the HelloWorld part to it. Not trivial by any means - but not impossible.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Just plug Uno-A into one USB socket and Uno-B into a second USB socket.

You can program the same sketch into Uno-A and Uno-B.

Once the sketches are Uploaded into the Unos, you can unplug from USB and power with batteries or external power supply.

In practice, life is simpler with USB. Buy a USB hub for your Laptop if you don't have enough USB sockets. Most Arduino projects take very little current. But a big 7" TFT screen or motor drivers are power hungry.

The USB cable I have that programs the Uno from my desktop has only 4 wires: Vcc, GND and Tx/Rx So in principal I can;t see why it would not work. I am sure there is a good reason why those 4 wires won't do it: It probably will become clear when i learn more (I am hoping).

I am a new AVR programmer. I am learning alone out of books, the Internet, etc. Please excuse me if I ask simple questions. Thanks.

So I looked at the ISP Programmer code Johan suggested: as expected I can not (at this time) modify it because I don't have the skill yet. Still, if I only had a simple frame work that I can inset my blink / hello world into I would be happy. I am going to try and hack the ISP Programmer program when I have the knowledge.

All I am looking to do is have "A" force it's program into "B", when that is done "A" will run it's blink / hello world block an so will "B"

I am a new AVR programmer. I am learning alone out of books, the Internet, etc. Please excuse me if I ask simple questions. Thanks.

There is a critical USB "issue" that the OP appears not to know about. That is that USB devices come in several "flavors" One is "host" - this kind communicates with other USB devices. Another is "client" - it is controlled by hosts. Another flavor is "OnTheGo - OTG" which is a special kind of client that can work as a reduced functionality host. Another is "hub" which can serve as an intermediary between hosts and clients.

The problem comes from the fact that USB is not just a "send a message" system. There is a very complex "stack" that manages each devices operation. Host stacks are very much more complex than client stacks and will typically NOT fit into things a whole lot smaller than, lets say, a RaspberryPi. Yes, I do recall that there is one AVR that can function as a host (maybe an OTG host?) but it is not your ordinary run-of-the-mill AVR.

The short conclusion is that just because it has an D+, D-, common, and power does NOT mean that it can function as a host, or even an OTG device. It also has to have the stack.

I thought about this problem: I am getting the impression it would probably not be practical (at my stage of understanding) to try to implement this. Discretion is osme times the better part of valor :-)

So I will drop the idea for now: bigger fish to fry out there.

Thank you everyone for the help though. I learned a bit more and that is certainly worth the trouble!

I am a new AVR programmer. I am learning alone out of books, the Internet, etc. Please excuse me if I ask simple questions. Thanks.

The major point is that Uno-A and Uno-B are both functional. i.e. they can both upload the sketch with their bootloaders.
.
Yes, you can destroy the bootloader on Uno-B if you want. But you will need to use Uno-A to do the programming.
Then upload the sketch to Uno-A with its intact bootloader.
.
The real mystery is: WHY?
.
David.

It's either a brilliant idea worth millions, or he thinks it is too embarrassingly stupid to mention. ;-)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Just to say that you CAN do what you ask here. Any AVR can pass a program to any other and as long as that second one has a bootloader then it can program what it receives into itself.

Using Arduinos just makes this a bit more complex because in the Arduino infrastructure each board is already using its bootloading capability for the usual programming anyway. So if you are to re-use the existing stuff then when A talks to be B to send it the program it has to "look like" a PC running avrdude and sending data via the "-c arduino" protocol.

But ultimately anything is possible.

Like others here I don't see how a (long!) UART cable from A to B is "better" for programming it than a USB cable stretching from the PC alongside A to B instead? Why does A need to act as a "proxy" (which is what it really is) here?

Any AVR can pass a program to any other and as long as that second one has a bootloader then it can program what it receives into itself.

And not only that, I suppose. Many AVRs should be capable enough to be ISP programmers on their own. Towards the host is exposes itself as a bootloader, and towards the AVR actually to be programmed it does ISP. Takes some work, but I can't see why it should not be do-able.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]