Flash from SD Card

Hello, I don't know much about the Arduino flashing or bootloader, but I know that there are several people who have managed to flash the Arduino from an SD card (where their code is stored).

I would like to do the same to expand one of my projects, many searches on the Internet led me to one of Nick Gammon's threads (Post). I was like 3 hours trying to make it work but I couldnt, and the problem is that I dont understand his post very well (sorry for that).

I would be very grateful if someone could tell me exactly:

  1. How to connect the cables between the 2 Arduinos UNO and the SD card.
  2. What code to use among all those there (Github Code) to be able to load a code saved in the SD card to flash it in the Arduino Target.
  3. How to correctly save the codes on the SD card.

Yes, I know that this post is a tutorial on how to do it :l, but Im very confused about how it is connected correctly and what code to use (because there are many examples), I also saw that there are some posts of this topic on this forum, but they all led to Nick Gammon's post.

Thanks!!!

Post the code that you wrote.

Well, technically I have nothing, I tried a lot but it didn't work for me. And it is not that I have invented a code, but because I do not know how to connect the arduinos and the SD card with each other, also there are many example codes in the link that I sent and I do not know exactly which one to use.

I don't know how to connect it correctly, I don't know what code to use either.

I think that to be able to flash an Arduino from another Arduino with the sketch saved on an SD card, you have to use one of the files in the Atmega_Hex_Uploader or Atmega_Hex_Uploader_Fixed_Filename (link) folder, but I'm not sure, there are many .ino files inside these folders.