I am using CODESYS on a multiprocessor platform (Verdin iMX8M) that consists of a Cortex-A53 processor which runs Linux (and CODESYS) and a Cortex-M4 processor which runs a FreeRTOS application. I am trying to send data through a reserved memory location from the FreeRTOS application to CODESYS and vice versa.
I reserved a segment of RAM as shared memory and both Cortex-M4 and Cortex-A53 cores can successfully read and write to it. I verified this through a primitive Linux application that uses mmap for accessing the physical address of the shared memory segment.
I tried to access the shared memory segment from CODESYS with SysShm library. Upon calling the SysSharedMemoryCreate() function, I assign the ulPhysicalAddress parameter with the physical address of my shared memory segment. The function fails and returns RTS_INVALID_HANDLE.
Does the SysShm library even support this kind of configuration where we share memory segments with another processor? If not, what is the purpose of the ulPhysicalAddress parameter?
Is there any other way to access a memory segment via its physical address from CODESYS? If yes, could somebody please provide an example?
Thank you and kind regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone,
I am using CODESYS on a multiprocessor platform (Verdin iMX8M) that consists of a Cortex-A53 processor which runs Linux (and CODESYS) and a Cortex-M4 processor which runs a FreeRTOS application. I am trying to send data through a reserved memory location from the FreeRTOS application to CODESYS and vice versa.
I reserved a segment of RAM as shared memory and both Cortex-M4 and Cortex-A53 cores can successfully read and write to it. I verified this through a primitive Linux application that uses mmap for accessing the physical address of the shared memory segment.
I tried to access the shared memory segment from CODESYS with SysShm library. Upon calling the SysSharedMemoryCreate() function, I assign the ulPhysicalAddress parameter with the physical address of my shared memory segment. The function fails and returns RTS_INVALID_HANDLE.
Does the SysShm library even support this kind of configuration where we share memory segments with another processor? If not, what is the purpose of the ulPhysicalAddress parameter?
Is there any other way to access a memory segment via its physical address from CODESYS? If yes, could somebody please provide an example?
Thank you and kind regards.