[Solved] Delay on the GIGA M4 core?

Hello Everyone, I am working on a timing sensitive Project, in which I use the Arduino GIGA board as a trigger for external applications. I outsourced parts of the code to the M4 core, so that this part can run on it uninterrupted by other parts of the code.
I noticed a delay (only on the M4 core) in this minimal example of my code.

This is the M7 Sketch:

#include<RPC.h>

void setup() {
  Serial.begin(57600);
  RPC.begin();
}

void loop() {
  
}

This is the M4 Sketch:

#include<RPC.h>
const int TRIGGER_FLASH = 2;
void setup() {
  // Serial.begin(57600);
  pinMode(TRIGGER_FLASH, OUTPUT);
  RPC.begin();
}
long FLASH_DURATION_TIME = 300; // High time of signal in µs
long FLASH_OFF_TIME = 200;      // Low time of signal in µs
void loop() {
  while (true) {
    digitalWrite(TRIGGER_FLASH, HIGH);
    delayMicroseconds(FLASH_DURATION_TIME);
    digitalWrite(TRIGGER_FLASH, LOW);
    delayMicroseconds(FLASH_OFF_TIME);
  }
  
}

This should produce a Period uf 500 µs. I measure a period of 780µs however. When setting the period to 2 ms in the sketch I can measure a value of 3.12 ms. After repeating this for a couple of different values, I calculated a factor of about 1.5 to 1.6 offset in the period.

Does anybody know whre this offset is coming from?

It seems there was a similar post in April, that I didn't find until now for some reason.

Here is the link: Incorrect number of microseconds for M4 coprocessor core

The issue is kind of solved in that post.

Hi @bab0 , the M4 timing problem is currently being investigated, and you can read more about it in this issue.

I am also working on a time sensitive app for the giga because it fits the display, and I had thought it might simplify my life to put the time sensitive tasks on a separate core (clearly I was wrong on that). Anyway, the last updates I see on this issue are from 4Q 2023. Has there been some kind of fix released since then?

Hi @laramsey.

If you are referring to the referenced GitHub issue, it is because it was resolved then. There is no reason to add any updates to an issue after it was solved.

Yes. The fix was released in version 4.0.10 of the "Arduino Mbed OS Giga Boards" platform,