Watchdog callback setting problem with Arduino UNO Wifi Rev2.

Hello.
I am having watchdog callback setting problem with Arduino UNO Wifi Rev2.
I need to eeprom update using watchdog callback(ISR) before board's reset.
That's why I want to WDIE bit setting.

Below is my simple test code.
------------------------------------code-----------------------------------------------------------
#include <avr/wdt.h>

void setup() {
wdt_enable(WDTO_2S);
WDTCSR |= (1 << WDIE); // set the WDIE flag to enable interrupt callback function.
}

ISR(WDT_vect)
{
//update eeprom
}

void loop() {
}

When I compile, I got this error message.
-------------------------------------error message-----------------------------------------------
Arduino: 1.8.9 (Windows 7), Board: "Arduino Uno WiFi Rev2, None (ATMEGA4809)"

C:\Users\User\Documents\Arduino\wdt_test\wdt_test.ino: In function 'void setup()':

wdt_test:5:3: error: 'WDTCSR' was not declared in this scope

WDTCSR |= (1 << WDIE); // set the WDIE flag to enable interrupt callback function.

^

wdt_test:5:19: error: 'WDIE' was not declared in this scope

WDTCSR |= (1 << WDIE); // set the WDIE flag to enable interrupt callback function.

^

exit status 1
'WDTCSR' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I tried same code with Arduino UNO. It's fine.

Can anybody help me solve this problem with Wifi rev2? (Atmega4809)

Despite the similar names, the Uno and Uno WiFi Rev2 are quite different and have different register names. You'll need to study the ATmega4809 datasheet to see how to modify your code to work with that microcontroller.

Enabling the watchdog is trivial, though the 4809 watchdog only supports reset, not interrupt on timeout:

CPU_CCP = 0xD8; // Disable IO register write protection
WDT.CTRLA = 0xB; // 0xB = 8.192s, other values are listed in the data sheet

The 4809 doesn’t have an interrupt/callback mode on it wdt.