Atmega2560 jtag programming

hii . i have a custom board with atmega2560 Arduino, and the Arduino connection to jtag header through pins pf4 to pf7 , and my question is can i program the Arduino through a jtag interface ?
i bought the atmel ice adapter , is there any tutorial that explains how to program Arduino by jtag , i be very glad for help

If you use PlatformIO, you can use JTAG for programming as long as you set up the platformio.ini file correctly.

See MegaCore PlatformIO.md for more information.