Cannot deploy Simulink Real-Time model that links to custom QNX shared object

16 Ansichten (letzte 30 Tage)
Situation:
1) Some simple custom test libraries (one static library and one shared object) written in C and cross-compiled for QNX using qcc toolchain included in the support packages that accompany a Speedgoat target machine
2) A cross-compiled for QNX test program that calls functions from the above libraries. When the program is manually copied to the target computer (and the shared object library copied to /lib on the target), I can run the program fine. (As expected it does throw an error if the shared object is not also copied over).
2) A C S-Function that also calls functions from the above libraries, successfully compilied into a MEX file.
3) A Simulink Real-Time model with an S-Function block referencing the above S-Function. The model builds successfully after specifying the locations of the custom headers and libraries in the Model Setting > Code Generation > Custom Code > Code Information.
4) When attempting to deploy the model to the Speedgoat, I get the following error (and no other information)
Error:Unable to load 'my_c_sfunc_model_rt' on target computer 'Speedgoat': Timed-out waiting for condition.
5) If I remove the references to the shared library from the S-Function C code and recompile everything (MEX and Simulink RT model), the model can be deployed and run successfully.
Question
Issue seems to be related to using the sharred object given (5) above. Would like to know what I am potentially not doing or doing wrong. Or at least some way to get a more helpful error message.
These pages did not help (i.e., I seem to already be doing everything they suggest)
  2 Kommentare
Francesco Sabbatini
Francesco Sabbatini am 22 Feb. 2024
Bearbeitet: Francesco Sabbatini am 22 Feb. 2024
I have the same situation. Did you find a solution?
Brandon
Brandon am 22 Feb. 2024
Don't remember if I completely got this sorted, but there's was some not very well explained info here about the need to guard QNX specific code with preprocessor define guards checkig SIMULINK_REAL_TIME. Not sure that solved the linking issues.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Ninad
Ninad am 4 Sep. 2023
The error message, "Timed-out waiting for condition," suggests an issue with loading the shared object library on the target computer. To troubleshoot, follow these steps:
  1. Verify the shared object library: Ensure it is cross compiled for the QNX platform using the qcc toolchain. Check compatibility with the target machine's architecture and OS.
  2. Check library dependencies: Ensure all required dependencies are present on the target computer. Use tools like ‘ldd’ (List Down Dependencies) or ‘readelf’ to check library dependencies. Add any missing dependencies.
  3. Check library search path: Place the shared object library in the correct search path, typically ‘/lib’ or ‘/usr/lib’ directories. Set ‘LD_LIBRARY_PATH’ to include the library's directory.
  4. Enable verbose mode: Enable verbose mode during deployment to get detailed error messages. Consult your deployment tool's documentation for instructions.
  5. Check system logs: Review system logs on the target computer for relevant error messages related to loading shared libraries. Logs can provide insights into the specific issue causing the timeout.
  6. Contact support: Reach out to Speedgoat or QNX toolchain support for assistance and specific troubleshooting steps.
Following these steps will help identify the potential issue causing the timeout and provide more helpful error messages.
  1 Kommentar
Francesco Sabbatini
Francesco Sabbatini am 22 Feb. 2024
Bearbeitet: Francesco Sabbatini am 22 Feb. 2024
I have the same situation of Brandon. When i try to load the Simulink RT Application (on Speedgoat Target) with the dependency of a shared library I receive error:
"slrealtime load --AppName MainAppTestLib"
"[2024-02-22 10:57:15.504000] [0x00000001] [error] Load error: Time out waiting for the expected status"
1) yes, the shraed library was correctly created with the Simulink Rea Time toolchain
2) yes, I checked the list of dependencies with command "ldd". All the dependencies are satisfied.
3) yes, shared library is placed at "/usr/local/lib" with root access and the path is correctly set in env variable "LD_LIBRARY_PATH". The file permission of shared library is set to 755.
4) How I can enable verbose mode for "slrealtime load" command?
5) Where is located system logs for Speedgoat Real time target?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by