<?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>How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114151/how-to-build-nanopb-proto-sources-into-a-zephyr_library</link><description>I&amp;#39;m currently porting a project that was originally developed on NRF5 SDK to Zephyr RTOS. 
 
 We used protobuf in varoius places. We also have multiple different conditional builds for different target markets that enable or disable certain features so</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Sep 2024 17:56:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114151/how-to-build-nanopb-proto-sources-into-a-zephyr_library" /><item><title>RE: How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/thread/502365?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2024 17:56:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81859b30-e7ee-4636-ad1c-feb80229e365</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;For anyone else interested in nanopb in a zephyr library here is a discussion I had on github that helped me get it working:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/discussions/77494"&gt;github.com/.../77494&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/thread/500061?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 17:23:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6049daf9-8a81-49ba-aa3b-3e5556105ba2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the clarification. According to this commit: &lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/86c92869d25fb85444c7b4a0de6d03b94d9c688e"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/86c92869d25fb85444c7b4a0de6d03b94d9c688e&lt;/a&gt; , it seems that you&amp;#39;ll need to convert your &amp;#39;lib&amp;#39; directory into a &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/develop/modules.html"&gt;Zephyr module&lt;/a&gt; to create a Zephyr library. The library can then be enabled and configured&amp;nbsp;in your applications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/thread/499828?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2024 17:24:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa69c4da-fb7c-4db8-95b4-0375643f2b8f</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;I&amp;#39;m not asking to make nanopb a separate library, I&amp;#39;m trying to make the generated protobuf c files that have been implemented as multiple modular schemas into a zephyr library.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The .proto file are located in a lib/schema/schema.proto.&amp;nbsp; &amp;nbsp;protoc and the nanopb generator should be used to convert those files into .c and .h files located in the lib/schema&amp;nbsp; &amp;nbsp;and those .c and .h files should be added into the build from the lib/schema/CMakeLists.txt and compiled into a zephyr_library()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the nanopb examples add the .proto files from the application folder which does not scale well when there are multiple application folders, such as when there is a manufacturing test application and multiple applications for different markets/products.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/thread/499698?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2024 09:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90e6dfcc-2b56-4828-b034-a2e21cd04abd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It’s not clear to me why you would build nanopb as a separate library rather than using the integrated Zephyr module as demonstrated in the sample application. When using the module, the generated source files will be placed in the build folder. Are you looking to have the generated source files copied to your project source directory instead, or is there other functionality missing in the Zephyr integration of nanopb?&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;If you want to build a separate linkable library from your project, you can use the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/zephyr/samples/application_development/external_lib/README.html"&gt;External Library&lt;/a&gt;&amp;nbsp;sample as a reference.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/thread/499615?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 16:03:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c32fb61-d6b8-4550-a3b1-53461a8545f6</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;The issue isn&amp;#39;t with configuring the build, Kconfig and prj.conf handles that just fine.&amp;nbsp; I&amp;quot;m trying to figure out the cmake parts of the system, which I&amp;#39;m as experienced with.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The nanopb common files need to be added into the project somewhere, probably in the app cmake, and then in the library folder the optional proto files need to be converted into .c and .h files and then those files compiled into a library.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Perhaps someone could suggest a better forum for me to get help on this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to build nanopb proto sources into a zephyr_library</title><link>https://devzone.nordicsemi.com/thread/499603?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 14:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d19633aa-5fb2-4033-b9f2-a120d7201fde</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have that much experience with Protobuf, but wouldn&amp;#39;t it be sufficient if you could conditionally select the *.proto file during compilation?&amp;nbsp; Below is a demo sample I created&amp;nbsp; based on the nanopb project that selects the *.proto file based on&amp;nbsp; the Kconfig&amp;nbsp;configuration (CONFIG_SAMPLE_PB_PROD_A or CONFIG_SAMPLE_PB_PROD_B).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Project&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nanopb_5F00_332011.zip"&gt;devzone.nordicsemi.com/.../nanopb_5F00_332011.zip&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Build command&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ west build -b &amp;lt;target board&amp;gt; -- -DCONFIG_SAMPLE_PB_PROD_A&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>