I have hit a problem which I have little expertise to solve. Please bear with my explanation since the system setup, applications build process, and the nature of the problem may be complicated and difficult to explain.
I have patched the Linux RPi kernel version 5.15.32 to prepare it to build Xenomai on it and then have also built the EtherCAT Master on the system (RPi CM4 on custom carrier board). For reference purposes, we want to EtherCAT communication to control a multijoint robot system, and each joint has its own slave. There are a total of 6 slaves per master port (there are two EtherCAT masters over two PCI Ethernet ports).
Our programming tool is Codeblocks and we want to use it in Release Mode.
The EtherCAT communication along with Xenomai real time thread works well with the Codeblocks debug mode; however, the algorithm run time per loop is slow as expected in Debug mode.
While Xenomai and EtherCAT Master applications work perfectly well in the Debug mode, the running in the release mode is the problem.
When we run our code in the release mode, the EtherCAT Master fails to initialize after slave configuration citing a very ambiguous "bus error" on the console window, and the dmesg message is displayed as:
Code: Select all
[2211.855899] EtherCAT 0: Starting EtherCAT-OP thread [2211.861444] Alignment trap: not handling ed9e6a00 at [<00013047>] [2211.861469] 8<--- cut here --- [2211.861495] Unhandled fault: alignment exception (0x221) at 0xb6f48012 [2211.861524] pgd = 08b91656 [2211.861545] b6f48012] *pgd=059dd003, *pmd=1fe3b5003 [2211.862181] EtherCAT 0: Releasing Master
I have read that Release Mode gives away strange errors called "Release - Only Bugs." I hope there is a solution to this.
Xenomai thread without EtherCAT works perfectly in release mode.
I am stuck and I would be grateful for any kind of help. I can share more details along the conversation if required.
Thank you and awaiting your responses in anticipation.