Over the past few years, I've been designing and building many successful hardware/firmware projects on the ESP32 S3 Family within the Arduino IDE environment.
I recently started designing on the ESP32 C3. But I am getting a glitch on the MOST SIMPLE software clock to a shift register (basically just a fast BLINK.INO). Almost every second, my 1kHz pin toggle clock is stretched by about a cycle.
It seems to appear only when using the bootstrap pins (GPIO2, 8, 9 etc.) but unconfirmed. I am suspecting a hardware design fault, a watchdog reset or an unserviced interrupt - something that suspends the main loop for a bit. I have cut my code down to just BLINK at delay(1) and it still does it.
Post the exact code so others who so wish can attempt to duplicate this issue. That is even though it is apparently quite trivial. The loop() on an ESP32 is an RTOS task and it has a default tick rate of 1ms. That may have an influence but I don't see how it could only affect specific pins as you have described. Also say how you are measuring the wave form. Are you, for example, using a logic analyser ? If timing accuracy is important then there are also alternative methods of pulsing a pin without using delay() in the loop().
If there are no tasks created, I mean there is only one task in the loop() function, then should not it be given the whole time of the CPU? The scheduler would never be called upon -- is it correct?
Good question. If there are no background act ivies (such as managing the radio etc.) that does suggest the optimisation of dropping the scheduling activities. How exactly it is implemented under those circumstances on an ESP32 I do not know (yet). But maybe someone here does.