Want to know the steps and commands involved in programming an Arduino chip

I want to create an arduino programming environment in another arduino. That is to say I want to program an arduino (say UNO for instance) using another arduin.

Note : I am not talking about Arduino ISP. It is a different thing. It overrides the bootloader.

What we do is connect arduino to pc and run avrdude or ide to send the program to device. But here we will connect to another arduino and program it.

Note: Don't say impossible and don't ignore. I just need to know what commands are sent when programming.

I want to make wireless arduino programming station. Using arduino ide (a plugin for it). And no third party python script involved or what so ever. So making this simplest to use.

Thanks in advance.

Look at what avrdude does.

subhajitdas298: I want to create an arduino programming environment in another arduino.

another programming environment ? Like python ?

What we do is connect arduino to pc and run avrdude or ide to send the program to device. But here we will connect to another arduino and program it.

you mean like we do already with a pro-mini or ATTINY, use one UNO, connect to a second device, a pro-mini or ATTINY and SEND THE PROGRAM to that other chip ?

Note: Don't say impossible and don't ignore. I just need to know what commands are sent when programming.

is this how you ask for help ?

So making this simplest to use.

so, make it complicated so you can make it simple ?

THIS IS AN XY PROBLEM

you gave us your ideas on HOW to do a thing, ruled out what might be easy things and gave us a problem that does not exist for us to try to figure out.

the CORRECT WAY TO POST is to tell us your end goal. like how can I program an Arduino witlessly ? { I found the typo, but hey, it could fit the context )

Instead of implementing an avrdude clone on an Arduino, it may be easier to implement your own bootloader. Then you have full control over the data transmission from one Arduino to another one.

DrDiettrich: Instead of implementing an avrdude clone on an Arduino, it may be easier to implement your own bootloader. Then you have full control over the data transmission from one Arduino to another one.

My goal is to to implement on standard arduino boot loader.

subhajitdas298: My goal is to to implement on standard arduino boot loader.

Note : I am not talking about Arduino ISP. It is a different thing. It overrides the bootloader.

I guess I just do not understand bootloaders.

dave-in-nj: another programming environment ? Like python ?

you mean like we do already with a pro-mini or ATTINY, use one UNO, connect to a second device, a pro-mini or ATTINY and SEND THE PROGRAM to that other chip ?

is this how you ask for help ?

so, make it complicated so you can make it simple ?

THIS IS AN XY PROBLEM

you gave us your ideas on HOW to do a thing, ruled out what might be easy things and gave us a problem that does not exist for us to try to figure out.

the CORRECT WAY TO POST is to tell us your end goal. like how can I program an Arduino witlessly ? { I found the typo, but hey, it could fit the context )

Sir, do you talk or help? I would appreciate if give me some links.

dave-in-nj: I guess I just do not understand bootloaders.

No it's just that you don't understand the word 'help'. Try not to be so rude. Anyway I don't want to create a custom bootloader. I just want the steps of command involved.

The overall steps are compilation, linking and upload.

DrDiettrich: The overall steps are compilation, linking and upload.

No I mean the commands avrdude sends. Steps. Any documentation available?

Do a compile and upload with the IDE in verbose mode and you can see them all printed out as they run.

subhajitdas298: Any documentation available?

What are you talking about? AVRDUDE is very well documented. Have you looked at it? Google "avrdude documentation" and you'll see it all. Lists of commands, options, tutorials, everything. Why would we need to rewrite all of that here?

Delta_G: What are you talking about? AVRDUDE is very well documented. Have you looked at it? Google "avrdude documentation" and you'll see it all. Lists of commands, options, tutorials, everything. Why would we need to rewrite all of that here?

I could not find the values avrdude is sending to arduino bootloader, indicating the commands.

Isn't AVRDude open source?

If all you want to do is use one Arduino to to upload a hex file to another Atmega chip I'm sure all the necessary information is in the relevant Atmel datasheets. Considering how many Atmel microprocessors are made only a tiny tiny percentage get anywhere near an an Arduino system.

If you want to compile a C source file and create a hex file then you MUST use a PC.

...R By the way, I have seen no sign of anyone being rude to you in this Thread.

In this thread it seems that the original poster very strongly indicated that he realizes people might feel that this is an XY problem (XY problem means that the person asks for X but really needs Y, for example if on a hobbyist knitting website you ask X "How can I buy glue gun that uses electrically conductive glue" that seems quite specific - and the answer is you can't. Or nobody will answer. - But what the poster REALLY needs to be told is "you don't want a glue gun, you want a soldering iron. This is why. This is why a soldering iron works and even conductive glue wouldn't. This is what you need to know to learn to solder. This is how long it will take. Go buy a soldering gun." This is Y. So the person asks X but really wants Y. X is irrelevant.)

But in this thread the person absolutely INSISTED that he did not need Y, he wanted X. He said, in bold:

Note: Don't say impossible and don't ignore. I just need to know what commands are sent when programming.

He is 100% sure that it's possible, and the reason he is so sure, is because he knows that SOMETHING is sent over the USB wire and he is sure that an Arduino is able to send SOMETHING over the USB wire, and he needs to know what that SOMETHING is.

But he does give us a little tiny amount of rope to help him get to Y (even though he is asking for X) because mentions his usage case (he could have hidden it):

I want to make wireless arduino programming station. Using arduino ide (a plugin for it). And no third party python script involved or what so ever. So making this simplest to use.

So very literally, he wants to make a wireless station with arduino that gets a sketch and pushes it to another arduino, without involving a PC. He tells us what Y is. For all we know, the wireless arduino gets the sketches over bluetooth. He didn't ask anything about the connection between his wireless station and the Arduino plugin he had in mind. None. He just didn't ask about that wireless connection.

So let's replace OP's questoin:

OP was trying to ask: "Assuming I want to build a wireless programming station from an Arduino and can figure out how to make an IDE plugin that will send the compiled script to the wireless programming station over bluetooth -- how would the wireless programming station (running Arduino) program a second arduino connected to it over USB? In other words I want to be able to make the simplest possible station running Arduino (which is all I can program) that can accept a bluetooth connection, accept a compiled sketch wirelessly, then uploads the compiled sketch to an Arduino that it is connected to and programming. Is this possible? How do I do this"?

This phrasing is now extremely clear. But how can OP intercept the compiled sketch? We don't know that part. however, he didn't ask about this part. Maybe he has his own idea. Maybe it's a separate question. Maybe go ____ yourself. :) (GOOGLE. Google. Maybe go Google yourself.) :)

Rephrased OP question:

Assuming an arduino has a copy of a compiled sketch, how can it upload it to a second arduino over USB? What steps are involved in uploading it?

Perhaps the "commands" sent by avrdude are a misconception. In fact avrdude sends what the bootloader understands, based on its command line switches and arguments. Knowledge of the command line switches is not really helpful, because these are only understood by avrdude, but not by the bootloader.

Consequently the required information can be found in a guide on "how to implement a bootloader for avrdude" or similar.

@curious48 has produced a useful analysis in Reply #15 - much of which I agree with.

But I'm not sure if it closely reflects the OP's X or Y, or even if the OP really has Z in mind.

When I wrote Reply #14 I had in mind the final short version of @curious48's re-phrasing - but I was quite prepared for the OP to say differently.

One does not need AVRDUDE to upload a hex file to an Atmega chip even though avrdude is a convenient way of doing so.

However without any further feedback from the OP this all seems a waste of time

...R

I have an UNO sketch here, (not written by me, only modified), that can clone itself onto another UNO. If you want to check it out to see what info you can derive from it, let me know and I'll dig it up and post it. I have to warn you that it's very poorly commented, so I'm not sure how helpful it will be.

Also, if I remember correctly, @CrossRoads, (one of the forum's moderators), has a standalone uploader that uses an SD card to hold the sketch to be uploaded. He might be able to give you some pointers.

I garnered that :

the OP is using words whose meaning are special to him and those definitions are not common to anyone else. hate to sound so negative, but if you truly understand the meaning of the word, (this is fundamental to human intelligence ) if you truly understand the meaning of the words, you will understand the concept and your communication will be clear and concise.

a "programming environment" means something special to the OP. 'That' meaning is not shared with the rest of us.

what we do know :

he wants to overide the bootloader he wants to use a standard bootloader

1) wireless

B) Arduino to Arduino programming. III ) well, he is a little light on this point.

I know that others have created a 'sketch uploader' you take it to your pre-configured Arduino UNO, plug it in, and it uploads said sketch. a travelling programmer, but AFAIK, has a direct connection.

If you have an Arduino that is already running a program with a wireless device, you would have been able to put in some sort of program that could set the device into a state to accept the new program. as DrDeitrich says, create a bootloader that has the ability to be put into this mode.

I do think the receiving Arduino would have to have been pre-programmed to be able to be put into a state in order to accept a new sketch this way. you could not do this to a raw Arduino.

another way to do this is to use a second Arduino. have a pair on the receiving end. one is running, connected to the net, bluetooth, xbee or some such. and that chip downloads the sketch, then programs the second Arduino.

taking this last bit a little further. the ESP8266 is already a second micro. it might be possible to connect that to the target Arduino and then send the program to the 8266 for it to program the target.

=================

In reading the post, and why I say this is an X/Y Problem is that he does not tell us what he wants to do. he only tells us the STEPS he is having problems with.

does he want to create a master virus dispensing device that will 'find' any run-of-the-mill arduino and then program it to his program ? ie: standard bootloader. we all know this is impossible.

Does he teach a class and want to take each board each day and sit it in the programmer and have it wirelessly program the board for the day's lesson ?

Does he want to make a device for use, say a thermostat. some imbedded device, then offer a way to wirelessly upgrade the software ?

Is he involved in a battle of the robots and wants to perform Kirk's Kobayashi Maru manoeuvre ?

the REASON for doing this is not here, only the steps he wants to do. that is one of the fundamental tenets of an X/Y Problem.