PN532 works on the Uno R3 but not on Uno R4

Gilshultz, thank you.
I have already tried the same configuration with 3.3k resistors, results are the same.
Switches on the PN532 board have been double/triple checked and trials repeated at least three times, both with R4 and R3.
This is the test code I have been using

/*
 * librerie NDEF 
 * https://github.com/don/NDEF
 * e richiede anche
 * https://github.com/Seeed-Studio/PN532
 * 
 * https://www.dummies.com/consumer-electronics/nfc-data-exchange-format-ndef/
*/
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>

PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);


//#include <SPI.h>
//#include <PN532_SPI.h>


//PN532_SPI intf(SPI, 10);
//PN532 nfc = PN532(intf); use ndef library instead
//NfcAdapter nfc = NfcAdapter(intf);



//display
//#include <LiquidCrystal_I2C.h>

//#define I2C_ADDR 0x27 
//#define BACKLIGHT_PIN 3
//#define En_pin 2
//#define Rw_pin 1
//#define Rs_pin 0
//#define D4_pin 4
//#define D5_pin 5
//#define D6_pin 6
//#define D7_pin 7

//LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


void setup(void) {
  Serial.begin(9600);
  Serial.println("NDEF Reader");
  nfc.begin();

  //lcd.begin(16,2);
  //lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
  //lcd.setBacklight(HIGH);
  //lcd.home();  
  //lcd.setCursor(0,0);
  //lcd.print("NFC Reader"); 
}

void loop(void) {    
  if (nfc.tagPresent()) {    
    NfcTag tag = nfc.read();
    String id = tag.getUidString();

    if (tag.hasNdefMessage()) {
      NdefMessage message = tag.getNdefMessage();
      Serial.print("\nThis NFC Tag contains an NDEF Message with ");
      Serial.print(message.getRecordCount());
      Serial.println(" NDEF Record");
      
      // cycle through the records, printing some info from each
      int recordCount = message.getRecordCount();
      for (int i = 0; i < recordCount; i++) {
        Serial.print("\nNDEF Record ");Serial.println(i+1);
        NdefRecord record = message.getRecord(i);
        
        Serial.print("  TNF: ");Serial.println(record.getTnf());
        Serial.print("  Type: ");Serial.println(record.getType()); // will be "" for TNF_EMPTY

        // The TNF and Type should be used to determine how your application processes the payload
        // There's no generic processing for the payload, it's returned as a byte[]
        int payloadLength = record.getPayloadLength();
        byte payload[payloadLength];
        record.getPayload(payload);

        // Print the Hex and Printable Characters
        Serial.print("  Payload (HEX): ");
        PrintHexChar(payload, payloadLength);

        // Force the data into a String (might work depending on the content)
        // Real code should use smarter processing
        String payloadAsString = "";
        for (int c = 3; c < payloadLength; c++) { //salto en0
          payloadAsString += (char)payload[c];
        }
        Serial.print("  Payload (as String): ");
        Serial.println(payloadAsString);
        //lcd.setCursor(0,1);    
        //lcd.print(payloadAsString);
        

        // id is probably blank and will return ""
        String uid = record.getId();
        if (uid != "") {
          Serial.print("  ID: ");Serial.println(uid);
        }
      }
    }
    
    } else {
      Serial.println("NOTAG");
      //lcd.setCursor(0,1);    
      //lcd.print("                ");
      delay(1000);  
    }
        
}