Hello
I am developing an gui application which is running in a Linux based system over a STM32MP2 hardware platform.
In this GUI app I am implementing a Device interface to get data from another external process which manage my hardware. in this way I am trying to separate the Ew code from my underlying system.
In this device interface (DeviceDriver.c) I am creating a worker tread to receive data from the "external hardware process" through a POSIX message queue. And once a message is received I send the data received from the worker thread to the GUI main thread using "EwInvokeCopy" method. Trying to avoid to execute code which is out of the context of the GUI thread.
But I am experiencing some "segmentation fault" and I am checking pointers, stack size, and contexts but I can't find where is the issue...
I would like to assure that I am working in a sure way and I get doubts about the process:
- I create a worker thread to receive binary data from a POSIX queue.
- I am sending received data from the worker thread to the GUI Main thread using EwInvokeCopy.
- In tne context of main thread I copy (memcpy) the " void * aData " received in a global variable defined in "DeviceDriver.c"
- After that I am accessing this global variable from the chora code using "nateive {}" statment.
Is it sure to accessing this global variable from the GUI thread while this variable is constantly updated from the worker thread (via main thread invokation)?
How could I could send my code in private?
Thank you.