I am noticing that on a RP2040 running at 200MHz, millis() is returning values that change faster then the wall clock. From some searches, I am finding that this might be normal since the Arduino core cannot compensate for that.
However, my search results are also saying that it is possible to tell the core or the compiler about the clock rate and it will compensate. Alternatively, use a library that can handle the overclocked speed.
So, I am thinking that the clock runs fine but for some reason, it jumps 22s ahead while running some code in the setup() function. After that, it seems consistently off by the same 22s.
Do you mean 22 ms? Is it the time since the sketch actually started and you reported the first millis?
Since you have not posted the code we can't test. Good luck.
In my sketch, the first thing that happens is that the rp asks for the current time. My RP does not have WIFI so I can't use anything over the networks.
After that the sketch does a calibration cycle of an external of some external HW. Then, the main UI is display, where the time is shown.
What I was seeing is that the time shown in the main UI was not synched to the time on my wall clock. My assumption was that there is something odd since the RP was running at 200Mhz when the default rate is ~125MHz.
It turns out that some time had passed between the RP booting and the clock starting to when I input the time. Since my sketch was not compensating for that, there was a time discrepancy.