Shared Memory Communication

elsabz
2020-06-22
2020-12-21
  • elsabz

    elsabz - 2020-06-22

    Good morning codesys world, I tried to install the "Shared Memory Communication" example under Raspberry PI 4. There is a problem in the execution of the myshm.c file. The file was regularly compiled with the "gcc myshm.c -o myshm -lrt" linux command. When I run the generated executable, I immediately receive a "Segmentation fault" error (see attached screenshoot). The file is the original downloaded from the codesys-store, how come it doesn't work? Can anyone help me?

    S.G.

     
  • elsabz

    elsabz - 2020-06-22

    SOLUTION FOUND !!! When executing the "./myshm" executable file, "sudo" must be prefixed for permission. Running the command "sudo ./myshm" always works well. I hope it can also be useful to someone else ...

     
    πŸ‘
    3
  • promaco

    promaco - 2020-12-21

    I've to added in the programm myshm.c the line:

    include <unistd.h> for compilation and running without errors on a Raspberri Pi 3</unistd.h>

     
    πŸ‘
    2

    Last edit: promaco 2020-12-21
  • elsabz

    elsabz - 2020-12-21

    Well, good to know, thanks!

     

Log in to post a comment.