Portenta H7 hangs using pulseIn() in gpio port

Using mid-carrier and portenta h7 pulsein works well with A pin like A0
but not with a digital pin like PD_5 (GPIO3). It Hangs!!
Best regards
Alejandro

Hi! Could you send the sketch snippet?

Hi PMarquinez,
sorry for the delay and thanks a lot for your fast response.
With A7 I generate a tone to messure the sqr signal with a gpio pin.
Remember I'm using the mid-carrier!

gpios (Mid-Carrier) PD_4, PG_3, PE_3 times out without getting any duration.
Analogs outputs works perfect with very accurate results.
Trying with PD_5 Hängs / freeze.
Same problem with two portenta H7 boards.
Best regards and many thanks for your help.

Alejandro
PS: I'm using in both boards the last firmware.



void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  while (!Serial);
  
  Serial.println("Initialized Serial");
  pinMode(A7, OUTPUT);
  tone(A7,200); // create a sqr to test pulsein
  pinMode(PD_5, INPUT_PULLUP); // PD_5 => Portenta Gpio3 in Mid-Carrier // Hangs / Freeze
  pinMode(A6, INPUT_PULLUP); // Analog pin  // This works perfectly
  // Both input signals use a 10Kohm to gnd
}

// For example gpios (Mid-Carrier) PD_4, PG_3, PE_3 times out without getting any duration.
// Analogs outputs works perfect and a freq messure is very accurate.
// Trying with PD_5 Hängs / freeze.
// Same problem with two portenta H7 boards
void loop() {

  delay(1000);

  Serial.print("Millis before pulseIn(A6,HIGH): "); Serial.println(millis());
  Serial.print("A6 Duration: "); Serial.println(pulseIn(A6, HIGH));
  Serial.print("Millis after pulseIn(A6,HIGH): "); Serial.println(millis());

  delay(1000);

  Serial.print("Millis before pulseIn(PD_5,HIGH): "); Serial.println(millis());
  Serial.print("PD_5 Duration: "); Serial.println(pulseIn(PD_5, HIGH));
  Serial.print("Millis after pulseIn(PD_5,HIGH): "); Serial.println(millis());

}