The watchdog timer is not stopping after the microcontroller enters sleep mode. The setting to stop counting in sleep mode is enabled in e2 studio. The behaviour is consistent across FSP versions.
I have merged two examples from Renesas to demonstrate the stated behaviour. I have added and enabled WDT in the sleep mode example. On the button press, the microcontroller goes to sleep and then it resets itself because the watchdog timer does not stop.
The expected behaviour is that the microcontroller must remain in sleep mode until the next button press event. I am also checking the reset cause at the time of boot and it also blames WDT.
The same behaviour has been observed on EK-RA6M3 as well.I am attaching the link to the project.
LPM WDT example
By default, the JLink doesn't allow the MCU to go into low power modes (it leaves the DBQIRQ bit set in the MCUCTRL register. The MCUCTRL is only accessible from the debug interface, not from the CPU) To be able to debug low power modes, you have to use a low power debugging script (attached and zipped, also distributed with e2studio), and set this in the debug configuration, and enable low power debugging for the JLink :-
The info about the limitation for the JLink in low poer debugging mode are listed here :-
https://wiki.segger.com/UM08001_J-Link_/_J-Trace_User_Guide#Low_Power_Debugging
CM_low_power_debug.zip
Please also clarify how to access the MCUCTRL register.
This solution seems working fine. Thanks a lot!