Portenta | PIR sensor on D6/PA8

Hi,

I have connected a PIR sensor like this to 2 different Portentas (w LoRa VisionShields):
VCC → 5V
OUT → D6/PA8
GND → GND

I noticed that the PIR was not working (giving constant false positive triggers) on one of the Portentas whereas was fine on the other Portenta. I wrote this basic program to test:

import pyb

pir = pyb.Pin("PA8", pyb.Pin.IN)

while True:
    print(pir.value())

And realised that the Portenta with issue has a constant HIGH (1). Why must that be happening? I have ensured that the header pins are properly soldered on both the boards.

Is there a way to define a PULL_DOWN on input pins to avoid this?

PC

pir = pyb.Pin("PA8", pyb.Pin.IN, pull=pyb.Pin.PULL_DOWN)