<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Generation of .matter files from .zap files</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109727/generation-of-matter-files-from-zap-files</link><description>Hi, 
 I am currently looking into setting up a Matter project (based on the template) and reached ZAP and the required files. As far as I understood, the &amp;quot;.zap&amp;quot; file is the only file that is actually needed, the corresponding &amp;quot;.matter&amp;quot; file is generated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Apr 2024 13:22:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109727/generation-of-matter-files-from-zap-files" /><item><title>RE: Generation of .matter files from .zap files</title><link>https://devzone.nordicsemi.com/thread/476905?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2024 13:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd0d3ce4-ed58-4262-a648-e13b2fb8e24d</guid><dc:creator>mlampacher</dc:creator><description>&lt;p&gt;Thanks for the explanation! Yeah, I&amp;#39;ve added a little CMake target to generate the `.matter` file, it&amp;#39;s straight-forward enough. I just found it very confusing that this is not part of the `chip_configure_data_model` already.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m very happy that Nordic integrated the `chip` project, that&amp;#39;s huge, great work!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of .matter files from .zap files</title><link>https://devzone.nordicsemi.com/thread/476887?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2024 12:51:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dfa2a05-bee7-417c-b952-c64f1b27aedd</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]what is the reason why the samples use &amp;quot;BYPASS_IDL&amp;quot;?[/quote]
&lt;p&gt;We use &amp;quot;BYPAS_IDL&amp;quot; in CMakeList.txt files because we decided to use static device-related Matter Data Model configuration in our samples. What does it mean? In the Matter Upstream repository, all Data Model files are generated dynamically utilizing ZAP tool while building an application. There are common &lt;code&gt;.zap&lt;/code&gt;&amp;nbsp;files for all samples and they have enabled all possible options. This approach requires the newest ZAP tool frequently, so users need to take care of it. In NCS samples we bypassed those&amp;nbsp;operations, and we generated all Data Model configurations to the&amp;nbsp;&lt;code&gt;zap_generated&lt;/code&gt;&amp;nbsp;directory within each sample and in this way, users don&amp;#39;t need to update ZAP within the same NCS revision, and also we removed many unnecessary options from samples &lt;code&gt;.zap&lt;/code&gt;files, and thanks to that we reduced the code size. Moreover, after bypassing those Data Model files are not generated during the building anymore.&lt;/p&gt;
[quote user="mlampacher"] I couldn&amp;#39;t find a single step where the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.matter&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file would be generated.[/quote]
&lt;p&gt;To generate Data Model files, they can follow the instructions from here: &lt;a title="https://developer.nordicsemi.com/nrf_connect_sdk/doc/2.6.0/nrf/protocols/matter/getting_started/adding_clusters.html#edit-clusters-using-the-zap-tool" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/protocols/matter/getting_started/adding_clusters.html#edit-clusters-using-the-zap-tool" rel="noopener noreferrer" target="_blank"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/protocols/matter/getting_started/adding_clusters.html#edit-clusters-using-the-zap-tool&lt;/a&gt;&amp;nbsp;or use the following command to re-generate the &lt;code&gt;.matter&lt;/code&gt; file only (from NCS main directory):&lt;/p&gt;
&lt;blockquote&gt;&lt;span&gt;&lt;em&gt;./modules/lib/matter/scripts/tools/zap/generate.py -&lt;/em&gt;o zap-gen-dir zap-file&lt;/span&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Where &lt;code&gt;zap-gen-dir&lt;/code&gt;&amp;nbsp;is the directory where &lt;code&gt;.matter&lt;/code&gt;&amp;nbsp;file will be stored into, and &lt;code&gt;zap-file&lt;/code&gt;&amp;nbsp;is the source &lt;code&gt;.zap&lt;/code&gt;file.Also it is worth mention, that they need to remove &amp;quot;zap&amp;quot; temporary directory to avoid many problems with zap tool&amp;quot;:Please read the &lt;code&gt;note&lt;/code&gt;&amp;nbsp;under that section: &lt;a title="https://developer.nordicsemi.com/nrf_connect_sdk/doc/2.6.0/nrf/protocols/matter/getting_started/adding_clusters.html#edit-clusters-using-the-zap-tool" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/protocols/matter/getting_started/adding_clusters.html#edit-clusters-using-the-zap-tool" rel="noopener noreferrer" target="_blank"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/protocols/matter/getting_started/adding_clusters.html#edit-clusters-using-the-zap-tool&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of .matter files from .zap files</title><link>https://devzone.nordicsemi.com/thread/476337?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2024 08:19:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6db7cd1-80bd-4be0-92ce-22b98d72cf8c</guid><dc:creator>mlampacher</dc:creator><description>&lt;p class="code-line" style="color:#000000;font-family:-apple-system, &amp;#39;system-ui&amp;#39;, &amp;#39;Segoe WPC&amp;#39;, &amp;#39;Segoe UI&amp;#39;, system-ui, Ubuntu, &amp;#39;Droid Sans&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin-bottom:16px;margin-top:0px;position:relative;text-align:start;text-indent:0px;text-transform:none;white-space:normal;" dir="auto" data-line="0"&gt;I had a deeper look into ZAP and the generator scripts and I guess I came to the same conclusion as you did:&lt;/p&gt;
&lt;ul class="code-line" style="color:#000000;font-family:-apple-system, &amp;#39;system-ui&amp;#39;, &amp;#39;Segoe WPC&amp;#39;, &amp;#39;Segoe UI&amp;#39;, system-ui, Ubuntu, &amp;#39;Droid Sans&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin-bottom:0.7em;margin-top:0px;position:relative;text-align:start;text-indent:0px;text-transform:none;white-space:normal;" dir="auto" data-line="2"&gt;
&lt;li class="code-line" style="position:relative;" dir="auto" data-line="2"&gt;
&lt;p class="code-line" style="margin-bottom:0.7em;margin-top:0px;position:relative;" dir="auto" data-line="2"&gt;The CMake integration of the Matter project does not have any targets to generate the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.matter&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file from the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.zap&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file (yet).&lt;/p&gt;
&lt;/li&gt;
&lt;li class="code-line" style="position:relative;" dir="auto" data-line="4"&gt;
&lt;p class="code-line" style="margin-bottom:0.7em;margin-top:0px;position:relative;" dir="auto" data-line="4"&gt;The&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;chip_codegen.cmake&lt;/code&gt;, however, assumes that a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.matter&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file is used (with the same name as the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.zap&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;input file, except for the file type) as input for the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;generate.py&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;script.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="code-line" style="position:relative;" dir="auto" data-line="6"&gt;
&lt;p class="code-line" style="margin-bottom:0.7em;margin-top:0px;position:relative;" dir="auto" data-line="6"&gt;Therefore, it is anyhow always necessary to trigger the code generation either via ZAP&amp;#39;s GUI or call&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;generate.py&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;elsewhere.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="code-line" style="position:relative;" dir="auto" data-line="8"&gt;
&lt;p class="code-line" style="margin-bottom:0.7em;margin-top:0px;position:relative;" dir="auto" data-line="8"&gt;Thus the code generation provided by the CMake integration may as well be skipped altogether (it is also very rare to update the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.zap&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file and virtually impossible to forget generating the files since otherwise nothing will work anyhow), also saving some compile/configuration time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="code-line" style="color:#000000;font-family:-apple-system, &amp;#39;system-ui&amp;#39;, &amp;#39;Segoe WPC&amp;#39;, &amp;#39;Segoe UI&amp;#39;, system-ui, Ubuntu, &amp;#39;Droid Sans&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin-bottom:16px;margin-top:0px;position:relative;text-align:start;text-indent:0px;text-transform:none;white-space:normal;" dir="auto" data-line="10"&gt;I&amp;#39;m still a bit unsure why the Matter project uses a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.matter&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file even though the same information is present in the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.zap&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file, which for now is always present (and can be used with&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;generate.py&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to generate the correct set of files, also shown in your documentation for adding a cluster to the example application).&lt;/p&gt;
&lt;p class="code-line" style="color:#000000;font-family:-apple-system, &amp;#39;system-ui&amp;#39;, &amp;#39;Segoe WPC&amp;#39;, &amp;#39;Segoe UI&amp;#39;, system-ui, Ubuntu, &amp;#39;Droid Sans&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin-bottom:16px;margin-top:0px;position:relative;text-align:start;text-indent:0px;text-transform:none;white-space:normal;" dir="auto" data-line="12"&gt;They mention in their codegen documentation that they &amp;quot;strive to make them contain only Matter-specific data&amp;quot; and that the &amp;quot;codegen.py&amp;quot; has less dependencies (but currently also doesn&amp;#39;t generate the full set of required files (?)) and that linting of&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.matter&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;files is possible.&lt;/p&gt;
&lt;p class="code-line" style="color:#000000;font-family:-apple-system, &amp;#39;system-ui&amp;#39;, &amp;#39;Segoe WPC&amp;#39;, &amp;#39;Segoe UI&amp;#39;, system-ui, Ubuntu, &amp;#39;Droid Sans&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin-bottom:16px;margin-top:0px;position:relative;text-align:start;text-indent:0px;text-transform:none;white-space:normal;" dir="auto" data-line="14"&gt;I guess it&amp;#39;s still a lot of &amp;quot;work in progress&amp;quot;. Due to the large amount of scripts and their awkward path handling (e.g., assuming either absolute paths or paths relative to the Matter root directory as parameters) this is currently still very confusing.&lt;/p&gt;
&lt;p class="code-line code-active-line" style="color:#000000;font-family:-apple-system, &amp;#39;system-ui&amp;#39;, &amp;#39;Segoe WPC&amp;#39;, &amp;#39;Segoe UI&amp;#39;, system-ui, Ubuntu, &amp;#39;Droid Sans&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin-bottom:16px;margin-top:0px;position:relative;text-align:start;text-indent:0px;text-transform:none;white-space:normal;" dir="auto" data-line="16"&gt;They also mention that &amp;quot;Currently .matter files are generated from .zap files during the application specific codegen.&amp;quot; but that is not true for the CMake integration - or at least I couldn&amp;#39;t find a single step where the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style="border-radius:4px;font-size:1em;line-height:1.357em;padding:1px 3px;"&gt;.matter&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;file would be generated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of .matter files from .zap files</title><link>https://devzone.nordicsemi.com/thread/476300?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2024 14:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e266ab8b-6ae2-4609-8958-760f379b6372</guid><dc:creator>mlampacher</dc:creator><description>&lt;p&gt;Happy Easter!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of .matter files from .zap files</title><link>https://devzone.nordicsemi.com/thread/476298?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2024 14:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82ca29fc-52d7-4fca-9106-e8a2e0e20b7e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Due to the Easter holidays in Norway, we are less staffed than usual.&amp;nbsp;Y&lt;span&gt;ou can expect an answer sometime next week,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Sorry for the inconvenience and thanks for your patience.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&amp;nbsp;&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>