DATA WRITE error in ESP 32S WROOM

#include "driver/gpio.h"
#define CLOCK 18  // CLK pulse output
#define STB 34  // STB pulse output
#define DATAREAD 21 // Data read from source
#define DATAWRITE 19 // Data write to ESP32



void setup() 
{
  Serial.begin(115200);
  delay(1000);
  Serial.printf("\n\nWorking on Kilig S01 ICE CUBE MAKER");
  pinMode(CLOCK, OUTPUT);
  pinMode(STB, OUTPUT);
  pinMode(DATAWRITE, OUTPUT);
  pinMode(DATAREAD, INPUT);
}

 void loop()
 {
     int data = digitalRead(DATAREAD);  // Read the state of DATAREAD (HIGH or LOW)
     Serial.print(data);
    while (data == true)
    { 
      stb_Kilig();
      gpio_set_level((gpio_num_t)STB, 1);
      for (int i = 0; i < 72; i++)         // 1uSec ON   30 nop = 1 micro seconds
        __asm__ __volatile__("nop\n\t");
        clock_Kilig();
        digitalWrite(DATAWRITE, data); 
    }
 }

In this code i am getting this error
gpio: gpio_set_level (227): GPIO output gpio_num error

I am using ESP WROOM 32
my IDE Driver version(esp32) is 2.x
i also have data input source

I have defined and working
clock_Kilig(); and stb_Kilig(); and i tested it seperately the output in oscilloscope , and both are working

Your code does not contain a line corresponding to this error.
It looks like you posted on the forum not the same code that you are compiling.

Please show A FULL CODE, including the module contains functions

in this i have the while program

and in main program tab i wan to keep a 4 microseconds delay how to keep it.
(i have pu it in comments where i need delay)

the error i an getting is

gpio: gpio_set_level (227): GPIO output gpio_num error

@b707

Your method of generating delays through nop operations is complete nonsense, why are you doing this? You will not create any precise signal this way, not to mention the fact that this is blocking code - which means that while you are creating such a delay, nothing else in the program can be executed.
To generate precise pulses at a given frequency, regardless of the main code, hardware timers are used.

And besides, in this file there are again no lines that could give such an error. Can you provide the error message in full - with file and line number?