Troubleshooting Running Out of File Descriptor Issues
Description
File descriptor running out warning or error messages (for example, WARN
[load_mon] <pthread> low on FDs! (1 FDs left)
) in the PX4
Console might cause undesirable behaviors.
Background
File descriptors are used to open and store uORB message handles, device driver
handles and so on. By default, the number of File descriptors is limited to
12
. PX4® runs out of file descriptors when large number of uORB Read / Write
blocks or any other device driver blocks are added.
When PX4 runs out of File descriptors, the serial port opening is also handled using a file descriptor, thus Monitor and Tune simulation (external mode) connection might also fail.
Workaround
Increase number of File Descriptors by performing these steps.
For the CMake config you are using, go to the corresponding
nuttx
config folder. For example, for
fmu-v5
go to
Firmware\boards\px4\fmu-v5\nuttx-config\nsh
Open the
defconfig
file.Modify the property
CONFIG_NFILE_DESCRIPTORS
to the desired number (for example, 20).Build the complete PX4 Firmware by navigating through the Hardware Setup screens. You can initiate the hardware setup process by opening the Add-On Manager.
In the Add-On Manager, start the hardware setup process by clicking icon.
Try building and deploying / running Monitor and Tune Simulation ( external mode) from Simulink®.
See Also
Troubleshooting USB Issues with Cube Orange on Windows | Troubleshooting PX4 Firmware Build Failure Due to Flash Memory Overflow on the Hardware | Troubleshooting Deploy to Hardware Issues