I am Akshay and i wanted to reach out because we are going to have our custom PCB soon in the office which has the MCU as same as Adafruit feather M4 express does. Although our board's MCU has additional pin-outs designated to some additional functionalities, but I was wondering how Arduino IDE can recognize the board? Do I have to create the custom variant for our board with a different name and modify the variant.cpp and variant.h files as per the additional pins being used on MCU?
Also, I am thinking to burn the same bootloader to our PCB which adafruit has on its feather m4 express board. IN this case, if I want to create a custom variant for our PCB, does bootloader need to modify as well?
I was wondering how Arduino IDE can recognize the board?
It normally "recognizes" the board by the USB VID/PID negotiated by the bootloader (when the bootloader is running) and/or the serial driver code (when the sketch is running.)
Do I have to create the custom variant for our board with a different name and modify the variant.cpp and variant.h files as per the additional pins being used on MCU?
Yes, that would be the best way.
Also, I am thinking to burn the same bootloader to our PCB which adafruit has on its feather m4 express board. IN this case, if I want to create a custom variant for our PCB, does bootloader need to modify as well?
legally speaking, you shouldn't re-use the Adafruit USB VID for your own board. And it won't uniquely identify as your board, either. Technically, I think it will work fine. The bootloader doesn't care about the pins that aren't involved in bootloading.