How to use INPUT_PULLUP on Portenta H7?

I am testing interrupts with my Portenta but I don't see any example code and the usual code doesn't work well.
If I only set the pinmode it looks promising:

  pinMode(PC_13, INPUT_PULLUP);

The pin goes high as usual.
However, if I then add the interrupt handling:

  attachInterrupt(PC_13, ISR_my_func, FALLING);

The pin no longer goes high.
Is there something else I should be doing instead of attachInterrupt()?

It works like intended if you attach the interrupt BEFORE setting the pin mode.
This works:

void setup() {
  attachInterrupt(digitalPinToInterrupt(GPIO_0), ISR_led_toggle, FALLING);
  pinMode(GPIO_0, INPUT_PULLUP);
}

This doesn't:

void setup() {
  pinMode(GPIO_0, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(GPIO_0), ISR_led_toggle, FALLING);
}

Is this intended? I did not know this was a thing :astonished:

Thanks for following up with your own question! I was struggling with the same problem until I found this post. It is a strange behavior indeed, I guess for some reason the attachInterrupt method acts on the pin configuration and removes the pull up resistance which gets reactivated only if the pinMode method is called afterwards...