<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Interfacing CODESYS and a microcontroller through shared memory </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dceaef5e85/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dceaef5e85/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/dceaef5e85/</id><updated>2022-04-29T17:03:01.702000Z</updated><subtitle>Recent posts to Interfacing CODESYS and a microcontroller through shared memory </subtitle><entry><title>Interfacing CODESYS and a microcontroller through shared memory </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dceaef5e85/?limit=25#e206" rel="alternate"/><published>2022-04-29T17:03:01.702000Z</published><updated>2022-04-29T17:03:01.702000Z</updated><author><name>ksalamun</name><uri>https://forge.codesys.com/u/ksalamun/</uri></author><id>https://forge.codesys.com49586c402b9eef82b700c55e86bb8ce1ef3ae2a4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone,&lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;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? &lt;/p&gt;
&lt;p&gt;Is there any other way to access a memory segment via its physical address from CODESYS? If yes, could somebody please provide an example?&lt;/p&gt;
&lt;p&gt;Thank you and kind regards.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>