fsfw-example-linux-mcu/doc/README-linux.md

1.9 KiB

Raising Message Queue Size Limit

The FSFW requires a higher message queue maximum lenght than the regular value configured for Linux. Failure to adjust this limit will cause errors when running FSFW applications.

The following steps raise the maximum allowed message queue length to a higher number permanently, which is required for some framework components. The recommended values for the new message length is 130.

  1. Edit the /etc/sysctl.conf file
sudo nano /etc/sysctl.conf

Append at end:

fs/mqueue/msg_max = <newMsgMaxLen>

Apply changes with:

sudo sysctl -p

A possible solution which only persists for the current session is

echo <newMsgMax> | sudo tee /proc/sys/fs/mqueue/msg_max

Setting up UNIX environment for real-time functionalities

Please note that on most UNIX environments (e.g. Ubuntu), the real time functionalities used by the UNIX pthread module are restricted, which will lead to permission errors when creating these tasks and configuring real-time properites like scheduling priorities. If you use the real time scheduler in Linux, perform the following steps:

Edit the /etc/security/limits.conf file and add following lines at the end:

<username>   hard   rtprio  99
<username>   soft   rtprio  99

The soft limit can also be set in the console with ulimit -Sr if the hard limit has been increased, but it is recommended to add it to the file as well for convenience. If adding the second line is not desired for security reasons, the soft limit needs to be set for each session. If using an IDE like eclipse in that case, the IDE needs to be started from the console after setting the soft limit higher there. After adding the two lines to the file, the computer needs to be restarted.

It is also recommended to perform the following change so that the unlockRealtime script does not need to be run anymore each time.