Arduino Ide 1.8.18 disconnects Portenda H7 Board on upload while code works well on adafruit feather m4 board

const int out_pin = A0; // Setting output pin
//const int Pin.Out_A0;
int count = 0;                               // counters
int t0 = 0;
double freq = 0;


void setup() {
    
    Serial.begin(115200);
    analogWriteResolution(16); // setting analog write resolution to 12 bits (0 - 4095)
    analogReadResolution(16);  // setting analog read resolution to 12 bits (0 - 4095)
    }

void loop() {

     t0 = micros();
     analogWrite(out_pin,1*count);
                  
     count += 1;