I was very interested in checking out what exactly happens during a sketch upload. I hooked up a logic analyzer to my board to check out what exactly occurs when the Arduino IDE uploads a sketch and I used the STK500 protocol docs (ver. 1) to decode the messages. Most of them are straightforward, but there was one set I could not find much information on: what are Universal Commands (command value 0x56) exactly? I've read the brief description and I've tried to decode the ones I see in my capture but I just don't get them
Specifically, after avrdude reads the device signature, it proceeds to execute the following Universal commands:
0x56 0x50 0x00 0x00 0x00 0x20 (3 times in a row)
0x56 0x58 0x08 0x00 0x00 0x20 (3 times in a row)
0x56 0x50 0x08 0x00 0x00 0x20 (3 times in a row)
It sends the same 9 commands after all memory pages have been updated too (for whatever reason).
So I dug around and tried to find something that could help decode the values 0x50, 0x58, 0x08. A couple posts online just say "Oh, those are just commands, the bootloader ignores them anyway", which... is fine, but completely useless. Skimming through the AVR datasheet and instruction set amounted to nothing (although I admit that I can easily overlook things).
I understand that the 4 bytes in every universal command are some sort of separate command, but... what, exactly ? What protocol does it belong to? What other command types exist? And, most importantly, what do they decode to? Are they important to the upload process? It has something to do with settings fuse and lock bits, but if someone could just break these commands into pieces and explain what they denote, I'll be really grateful!