<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Adding real NVRAM retain persistent memory</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/c05fa831f0/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/c05fa831f0/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/c05fa831f0/</id><updated>2020-02-27T15:59:50.407000Z</updated><subtitle>Recent posts to Adding real NVRAM retain persistent memory</subtitle><entry><title>Adding real NVRAM retain persistent memory</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/c05fa831f0/?limit=25#7dc1" rel="alternate"/><published>2020-02-27T15:59:50.407000Z</published><updated>2020-02-27T15:59:50.407000Z</updated><author><name>jfernandez88</name><uri>https://forge.codesys.com/u/jfernandez88/</uri></author><id>https://forge.codesys.com01d120f7e42b5cee5032ef8e14e13576c02963e5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Edwin !&lt;/p&gt;
&lt;p&gt;Yes, this link don't sept about the NVRAM but the chip DS1338 include 56KB of NVRAM :&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://datasheets.maximintegrated.com/en/ds/DS1338-DS1338Z.pdf" rel="nofollow"&gt;http://datasheets.maximintegrated.com/e ... S1338Z.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This work because I see the NVRAM on raspbian and I can write it with od command.&lt;/p&gt;
&lt;p&gt;So, you say that the problem would be the speed of access for this kind of memory ? Because of I2C ?&lt;/p&gt;
&lt;p&gt;If we don't need hi-speed, is it possible ? I try to find a method to map my 56KB I2C NVRAM to user space memory in linux... Any idea ? is it possible ?&lt;br/&gt;
How you doing that with bigger PLC ? How do you affect NVRAM memory in linux ? Is it in place by hardware conception ? Or by a linux driver setup ?&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Julien&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Adding real NVRAM retain persistent memory</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/c05fa831f0/?limit=25#d569" rel="alternate"/><published>2020-02-27T15:59:49.619000Z</published><updated>2020-02-27T15:59:49.619000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com85be653ada248b823bec404f77ebda1d660d1011</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
where in these links do we find the NVRAM descripton?&lt;br/&gt;
It is a RTC module and some I2C sensors... but NVRAM?&lt;/p&gt;
&lt;p&gt;Guess, even if a setting like would be possible&lt;br/&gt;
it will not work. &lt;br/&gt;
Because on retain in Sram setting we need a mapped memory area which will be accesses cyclic for the retain area&lt;br/&gt;
in your iec task where you use the retain vars.&lt;br/&gt;
If this is connected via I2C guess this will increase the plc cycle dramatically.&lt;/p&gt;
&lt;p&gt;In case of an unexpected poweroff, the write access should lead to a succesul write into the I2C connected NVRAM ... does this work&lt;br/&gt;
via I2C??&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Adding real NVRAM retain persistent memory</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/c05fa831f0/?limit=25#5ade" rel="alternate"/><published>2020-02-27T15:59:47.417000Z</published><updated>2020-02-27T15:59:47.417000Z</updated><author><name>jfernandez88</name><uri>https://forge.codesys.com/u/jfernandez88/</uri></author><id>https://forge.codesys.comcce897c710ef479aae2bfe0308e5b0757e5ee911</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want use this additional NVRAM card on the raspberry pi 2 and use the 56kB of NVRAM on Codesys :&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://www.cjemicros.co.uk/micros/individual/newprodpages/prodinfo.php?prodcode=4D-RaspberryPi-RealTimeClock-RTC" rel="nofollow"&gt;http://www.cjemicros.co.uk/micros/indiv ... eClock-RTC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1st : is it possible ?&lt;/p&gt;
&lt;p&gt;2nd : &lt;strong&gt;How ???&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I think we need to tell Codesys about where is referenced the NVRAM on the system.&lt;/p&gt;
&lt;p&gt;As you can see the chip is well reconize by raspbian :&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[    4.281346]&lt;/span&gt; bcm2708_i2c_init_pinmode(1,2)&lt;br/&gt;
&lt;span&gt;[    4.288983]&lt;/span&gt; bcm2708_i2c_init_pinmode(1,3)&lt;br/&gt;
&lt;span&gt;[    4.381423]&lt;/span&gt; rtc-ds1307 1-0068: rtc core: registered ds1307 as rtc0&lt;br/&gt;
&lt;span&gt;[    4.399365]&lt;/span&gt; rtc-ds1307 1-0068: 56 bytes nvram&lt;br/&gt;
&lt;span&gt;[    4.429732]&lt;/span&gt; bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 79) (baudrate 100000)&lt;/p&gt;
&lt;p&gt;and the NVRAM is well affected by raspbian :&lt;/p&gt;
&lt;p&gt;root@raspberrycodesys:/home/pi# find /sys -name nvram&lt;br/&gt;
/sys/devices/soc/3f804000.i2c/i2c-1/1-0068/nvram&lt;/p&gt;
&lt;p&gt;So, how can I say to the runtime "Please, use this kind of memory here for the retain data  /sys/devices/soc/3f804000.i2c/i2c-1/1-0068/nvram"&lt;/p&gt;
&lt;p&gt;We can say on the CODESYSControl.cfg file something like this :&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[CmpApp]&lt;/span&gt;&lt;br/&gt;
RetainType.Applications=InSRAM&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[CmpRetain]&lt;/span&gt;&lt;br/&gt;
Retain.SRAM.Address=0x10000000 (but it's bullshit on my situation....)&lt;br/&gt;
Retain.SRAM.Size........&lt;br/&gt;
etc...&lt;/p&gt;
&lt;p&gt;I think the only way to tell the runtime about the NVRAM's location is when 3S compile it... but maybe not. &lt;/p&gt;
&lt;p&gt;One solution would be that 3S add a new parameter for CODESYSControl.cfg like :&lt;/p&gt;
&lt;p&gt;Retain.SRAM.SysLocation= /sys/devices/soc/3f804000.i2c/i2c-1/1-0068/nvram&lt;br/&gt;
Retain.SRAM.Size=56K&lt;/p&gt;
&lt;p&gt;And here we go !!!!!&lt;/p&gt;
&lt;p&gt;Other idea ? Advice ?&lt;/p&gt;
&lt;p&gt;What is the 3S's position on the kind of feature request ?&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Julien&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: IMG_0331.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=1321"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>