the new WiFi library was published for the Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000 and Arduino UNO WiFi Rev.2.

for networking it uses SPI communication with the WiFi module and additional pins: SLAVEREADY signal from the firmware SLAVERESET to reset the WiFi moduleNINA_GPIO0 to put the WiFi module into flashing mode for firmware update

Serial2 of Atmega is connected to Serial of WiFi module for flashing the WiFi module over the Atmega, because the Atmega is connected to USB with UART0.

a version of SerialPassthrough sketch in Atmega will be used for the firmware update over Serial. in setup() it will reset the WiFi module into flashing mode