First of all, happy new year to everybody.

I start 2022 with an interesting project but I do not want to reinvent the wheel so I ask you your kind advice about the following.

I have a mother PCB, called the BASE which is equiped with a PIC 18F26K22 and uses some peripherals (USB bridge, PWM, I/O, etc…). Quite classical.
Some daughter PCBs called the EXTENSIONS can be connected to the BASE. They support additional functions and communicate with a PIC via an I2C bus. Several kinds of EXTENSION exist and each requires a different application program to be executed by the PIC. All the application programs are too large to simultaneously stay in the PIC program memory. So, each EXTENSION has an embedded EEPROM with its own application program. At powering, the PIC reads a code from the connected EXTENSION and verifies if it fits with any application program it may already have in its program memory. If this is the case it launches this application program. If not it reprograms itself with the application program stored in the connected EXTENSION EEPROM and then launches the application.

I hope my description is quite clear. Before I start, does anybody have some experience or knowledge about this kind of problem and/or see any traps or difficulties ?

Thank you for your advices and for your help.

Best regards
MikeBZH