How to use the RTC_PRD registers to trigger an interrupt ?

Hello, I am trying to use the Software Standby Mode on the R4 Minima. I made it work with the IRQ interrupts. It goes to sleep after 5seconds and only wakes up once an interrupt has been detected on pin13. The 5V part of the circuit consumes about 500uA which is good compared to the sleep mode of 4mA.

My problem is that according to the manual, it is possible to wake from Standby mode using the RTC_PRD (Periodic). I tried reading the manual as much as possible and doing everything they're saying to do.

Unfortunately I am not able to ever get out of the wfi unless I add 5V to the D13.

Has anyone managed to make the RTC interrupts cancel the Software Standby mode?

#define PORTBASE 0x40040000
#define P300PFS 0x08C0  // Port 3 Pin Function Select Register
#define PFS_P301PFS ((volatile unsigned int *)(PORTBASE + P300PFS + ( 1 * 4))) // D0 / RxD - IRQ6
#define SYSTEM 0x40010000 // System Registers
#define SYSTEM_PRCR     ((volatile unsigned short *)(SYSTEM + 0xE3FE))  // Protect Register
#define SYSTEM_SBYCR   ((volatile unsigned short *)(SYSTEM + 0xE00C))      // Standby Control Register
#define SYSTEM_SCKDIVCR ((volatile unsigned int   *)(SYSTEM + 0xE020))  // System Clock Division Control Register
#define GPIO_PIN PFS_P301PFS // Example for D0
#define INTERRUPT_MODE 0x02 // Hypothetical constant for rising edge

// Low Power Mode Control
#define MSTP 0x40040000 
#define MSTP_MSTPCRB   ((volatile unsigned int   *)(MSTP + 0x7000))      // Module Stop Control Register B
#define MSTPB11 11 // USBFS

// ==== USB 2.0 Full-Speed Module ====
#define USBFSBASE  0x40090000
#define USBFS_SYSCFG     ((volatile unsigned short *)(USBFSBASE + 0x0000))
#define USBFS_USBMC      ((volatile unsigned short *)(USBFSBASE + 0x00CC))
#define USBFS_USBBCCTRL0 ((volatile unsigned short *)(USBFSBASE + 0x00B0))

#define RTC_RCR1 ((volatile unsigned short *)(0x40044022))
#define RTC_RCR2 ((volatile unsigned short *)(0x40044024))

#define ELC_ELCR ((volatile unsigned short *)(0x40041000))

#define DMA_DMAST ((volatile unsigned short *)(0x40005200))

#define SYSTEM_SNZREQCR ((volatile unsigned short *)(0x4001E098))

#define DTCST_DTCST       ((volatile unsigned short *)(0x4000540C))

#define SYSTEM_OSTDCR   ((volatile unsigned char *)(SYSTEM + 0xE040)) 

#define ICU_WUPEN ((volatile unsigned char *)(0x400061A0))  // Oscillation Stop Detection Control Register

void handleInterrupt()
{
  Serial.println("INTERRUPTED");
}


void setup() {
  Serial.begin(9600);
  
  pinMode(13, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(13), handleInterrupt, RISING);
}


void rtcCallback() {
    // Code to execute when the RTC periodic interrupt occurs
    Serial.println("RTC TRIGGERED");
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(5000);
  *SYSTEM_PRCR = 0xA503;  // Enable write access to clocks and LowPower modes
  *SYSTEM_SBYCR = 0xC000; // Switches from Sleep to SoftwareStandby
  //*DTCST_DTCST = 0x01;
  *SYSTEM_OSTDCR = 0x00; // OSTDE, said it need to be set to 0
  //*SYSTEM_SNZREQCR = 0x0200; 
  *ICU_WUPEN = 0x0200DFFF; // Sets the conditions to wake up : RTC Periodic + IRQ0 to 15.
  *RTC_RCR1 = 0xE4; // Sets Periodic on and set to 1Second
  *RTC_RCR2 = 0x01; // set the start bit to 1.
  *ELC_ELCR = 0x80; // not too sure, links events ?
  *DMA_DMAST = 0x00;  // said it need to be set to 0
  *DTCST_DTCST = 0x00; // said it need to be set to 0
  delay(100);
  asm volatile("wfi"); 
}