1. Is ./control_loop your software which is (if I understand the command line correctly) supposed to run on CPU 3? htop shows several instances of it running on the other cores. And the "primary" process is shown as running on CPU 2.
2. Are you using the normal kernel I2C interface routines? If so, this presumably exposes you to interference from the kernel during I2C accesses - maybe the scheduler sometimes takes a while to recognise that a transaction has completed and pass control back to your task.
Possibly you could prove this by substituting a short delay for the I2C task temporarily (although that will also use kernel services).
Incidentally, are you aware that isolcpus is deprecated as of a couple of years ago? You're supposed to use cgroupscpuset now (no, I haven't tried it yet).
Are you running Bookworm Pi OS?
This rather old post also makes interesting reading.
2. Are you using the normal kernel I2C interface routines? If so, this presumably exposes you to interference from the kernel during I2C accesses - maybe the scheduler sometimes takes a while to recognise that a transaction has completed and pass control back to your task.
Possibly you could prove this by substituting a short delay for the I2C task temporarily (although that will also use kernel services).
Incidentally, are you aware that isolcpus is deprecated as of a couple of years ago? You're supposed to use cgroupscpuset now (no, I haven't tried it yet).
Are you running Bookworm Pi OS?
This rather old post also makes interesting reading.
Statistics: Posted by stevend — Tue Apr 23, 2024 12:28 pm