For many reasons, I need to design my own PCB with an AVR/STM32. I need the PCB to be programmable with just a USB cable that can turn into serial monitor too from Arduino IDE in Windows. Exactly the same as the Arduino Uno or Nucleo development boards.
Solution 1-1: In Uno, there is a AT8u that should be programmed via ISP with a firmware. Then it programs the main AT8 via its Serial port by asserting DTR, because every AVR chip is shipped with a bootloader listening to its USART port. Where can I find the USB firmware?
Solution 1-2: Could I use a FTDI FT232R chip instead of AT8u and would Arduino IDE still recognize it?
Solution 1-3: If I want to get rid of the FTDI chip or AT8u, can I program an AVR chip with USB port, using ISP, with a USB bootloader that Arduino IDE recognizes?
Now same questions about STM32.
On the Nucleo dev boards, there is another STM32 that probably has a firmware that connects to PC via USB and programs another main STM32 using its SWD port. Can I have those exact chips on my PCB and program the first one through its SWD (using a STLink) with proper firmware (Where is that?), so that I can use a USB cable afterwards?
Can I use a STM32 device and program it using its SWD with a USB bootloader that takes sketches from its USB port afterwards? Where is that bootloader (for any STM32 and not just marple-mini boards? Is that programmer integrated into Arduino IDE?
I know about https://www.youtube.com/watch?v=wGbiT6IxGP0 for example, but can I use this for my own board with any STM32 device?
I need the best-solid solution. I search A LOT and I couldn't find one. Please help.