We have a potential early adopter who is requesting write cache to be disabled due to possible data loss if the system crashed before cache was written to disk. I cannot find any .conf files to show me how the 2152 is configured with respect to this. Is write cache enabled or disabled? Does there exist the ability to change this configuration on the 2152 if so? Please advise.
What kind of ‘data’ are you trying to commit to ‘disk’? There is the retain variables concept in IEC61 1131. For more ‘elaborate’ data commits, usually from a C++ or higher-level language you have to take different steps. In order to flush your buffers, you can always call the OS-api’s, to directly flush caches, or create a file-handle using DIRECT-io (http://swoolley.org/man.cgi/2/open) But then, there is still the topic of hdd (or better sdcard-controller) caches and the ext4 file-systems (or different if you have made changed to the sd-cards storage). Those filesytems settings are also candidate for tuning behavior even more. But such operations require inherently more processing time, and are typically ‘blocking’, therefore you have to keep that in mind in an realtime-context
Can you be more concise regarding the specific requirements, amounts of data, and write-intervals, how ‘atomic’ are those writes supposed to be for example?
Customer will use fsync() from unistd.h to “flush” or write data to an SQLite DB he wants to install on the 2152. Write cache cannot be enabled however, because there is a possibility to lose data in the event of a crash. So no matter what method is being used to flush the buffers, it would all be for naught if write cache was enabled. Application aside, the only thing we need to know is whether its enabled or not and if it is, is there a way to disable it? The ability to do this is usually handled in, for example, hparm.conf , in a typical Linux installation using a hard disk. It is also typically enabled by default. I cannot find a comparable file on 2152 however.
hdparm is usually used for ubuntu distributions I think.
The Linux general would be the mount settings at fstab. I guess you could partition your SD and mount the part that stores the data with a specific configuration in /etc/fstab ?
keep the OS or FW partitions how they are.
that way you wont damage the IEC or Real Time behavior…
be carefull not to delete the License of your SD!
better make a recovery image before experimenting. You mentioned early adopter.
As far as I know the Early Adopter program is already over as the product has been relesed since end of last year…
Does your customer want to use the beta Hardware and FW?
Thanks for in the info Oliver. I will look into this and post back any results. Also, the customer does not have any hardware yet, but would potentially get release hardware. We are not officially released in the US since the hardware does not have UL yet, however. Not many customers will consider using a product without UL in the US but will accept for evaluation with the promise that UL is on its way. So we are still considering ourselves in “early adopter” phase since all of our potential customers are pretty much evaluating only.