I am running a runtime environment on an ARM A35 dual-core processor (1.5GHz) and have encountered some issues. The CPU load (both CPU0 and CPU1) occasionally spikes above 50% before returning to normal, and this happens around 2-3 times per minute. At the same time, Iβve noticed that the Max Cycle Time in the Codesys monitoring screen shows much worse performance compared to the A53 (1.2GHz), with nearly double the cycle time.
The optimizations I have made so far are as follows:
Set the CPU to performance mode.
Isolated CPUs: CPU0 is dedicated to running Linux services and the runtime itself, while CPU1 runs the EtherCAT task and the MainTask.
Despite CPU1 only running these two tasks, the utilization still increases above 50%, which I find unreasonable.
Additionally, I performed tests using cyclictest both without and with the runtime running. The performance is shown in the following image:
From the results, I believe the CPU performance should be fine, but I am unsure why the monitoring results are not as expected. The testing outcomes should ideally be as close as possible to the cyclictest results.
This is a phenomenon that I have seen myself and with others. Texas instruments wrote an application note with this same issue. They noted with Codesys 3.5.19.10, that selecting CPU 1 as the EtherCAT task showed CPU spiking improvements over the performance of cores 0, 2, and 3. It appears to be linked to EtherCAT, are you configuring for use with distributed clocks? If so, I recommend choosing the 'Based on Input Reference' option. I have found it to reduce the CPU usage spike maximum slightly (see attached).
I am running a runtime environment on an ARM A35 dual-core processor (1.5GHz) and have encountered some issues. The CPU load (both CPU0 and CPU1) occasionally spikes above 50% before returning to normal, and this happens around 2-3 times per minute. At the same time, Iβve noticed that the Max Cycle Time in the Codesys monitoring screen shows much worse performance compared to the A53 (1.2GHz), with nearly double the cycle time.
The optimizations I have made so far are as follows:
Set the CPU to performance mode.
Isolated CPUs: CPU0 is dedicated to running Linux services and the runtime itself, while CPU1 runs the EtherCAT task and the MainTask.
Despite CPU1 only running these two tasks, the utilization still increases above 50%, which I find unreasonable.
Additionally, I performed tests using cyclictest both without and with the runtime running. The performance is shown in the following image:
From the results, I believe the CPU performance should be fine, but I am unsure why the monitoring results are not as expected. The testing outcomes should ideally be as close as possible to the cyclictest results.
Does anyone have related solutions to this issue?
Last edit: z870623 2024-10-14
This is a phenomenon that I have seen myself and with others. Texas instruments wrote an application note with this same issue. They noted with Codesys 3.5.19.10, that selecting CPU 1 as the EtherCAT task showed CPU spiking improvements over the performance of cores 0, 2, and 3. It appears to be linked to EtherCAT, are you configuring for use with distributed clocks? If so, I recommend choosing the 'Based on Input Reference' option. I have found it to reduce the CPU usage spike maximum slightly (see attached).
See link to TI (also attached in case link breaks)
https://www.ti.com/lit/an/spradh0/spradh0.pdf?ts=1723546111357