I am going to solder a shield for a raspberry pi 3B. This shield will also contain an arduino nano. I need the arduino as a signal generator to control model trains. The RPI will run a program which communicates to this arduino serially.
I have a working setup and now I am packing it togather. My current plan is to use the usb cable to the arduino like I am doing now. But as I am soldering the arduino on the pi I started wondering. Could I use the Rx/Tx pins and 3V3 pin of the pi instead of the usb cable
Ofcourse that is possible. But unfortunately this raspberry Pi also needs to flash the arduino with new programs. I do this via the arduino-cli tool. The whole action is done remotely from my work PC. I send a hex file over with SCP and then I run a shellscript to start the uploading.
Now the question: Can I directly flash a program using just the Rx/Tx pins of both devices. I understand I also need to let the raspberry give a reset pulse on the arduino's reset pin in order for this to work.
Has this been done before? I am guessing it is not that hard and I can do it relatively easy, but asking in advance does not hurt right?