<?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>Can I modify nrf52840 manufacturer ID and model ID by using &amp;quot;flash write&amp;quot; command in shell sample?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111663/can-i-modify-nrf52840-manufacturer-id-and-model-id-by-using-flash-write-command-in-shell-sample</link><description>Hello, 
 I am looking to conduct a test to simulate a Zigbee device using nrf52840 in the Zigbee:shell sample. This involves modifying the manufacturer ID and model ID. If it is possible to modify them using the &amp;quot;flash write&amp;quot; command in the shell example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Jun 2024 13:56:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111663/can-i-modify-nrf52840-manufacturer-id-and-model-id-by-using-flash-write-command-in-shell-sample" /><item><title>RE: Can I modify nrf52840 manufacturer ID and model ID by using "flash write" command in shell sample?</title><link>https://devzone.nordicsemi.com/thread/487761?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 13:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0f00c66-4f1b-475d-a3e6-d90170ddd726</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi jostar,&lt;/p&gt;
&lt;p&gt;Since you mentioned this is for testing, I will&amp;nbsp;put down some ideas that could be botched up to work, but likely not proper enough for production code.&lt;/p&gt;
&lt;p&gt;Note that&amp;nbsp;ManufacturerName and ModelIdentifier are not supposed to be changed during a device&amp;#39;s lifetime, so&amp;nbsp;you probably shouldn&amp;#39;t do this for your end-product.&lt;/p&gt;
&lt;p&gt;With Shell, you can consider creating a custom Shell command, which would then write a value in NVS. The application would then&amp;nbsp;initialize NVS, read this value, and use it to setup the attributes.&lt;/p&gt;
&lt;p&gt;This is a nice blog about custom Shell command:&amp;nbsp;&lt;a href="https://blog.golioth.io/how-to-add-custom-shell-commands-in-zephyr/"&gt;https://blog.golioth.io/how-to-add-custom-shell-commands-in-zephyr/&lt;/a&gt;.&lt;br /&gt;My colleague made an unofficial custom Shell command sample here:&amp;nbsp;&lt;a href="https://github.com/martelmy/NCS_examples/tree/main/custom_shell"&gt;https://github.com/martelmy/NCS_examples/tree/main/custom_shell&lt;/a&gt;.&lt;br /&gt;NVS sample:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.1/zephyr/samples/subsys/nvs/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.1/zephyr/samples/subsys/nvs/README.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, you could use nrfjprog to write the value to UICR, and then read&amp;nbsp;and use the value to setup the attributes.&lt;/p&gt;
&lt;p&gt;A final alternative is using&amp;nbsp;ZB_ZCL_SET_ATTRIBUTE(). This is&amp;nbsp;meant to work with attributes that can change dynamically, so I am not sure if it will work with ManufacturerName and ModelIdentifier though.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I modify nrf52840 manufacturer ID and model ID by using "flash write" command in shell sample?</title><link>https://devzone.nordicsemi.com/thread/487686?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 10:20:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ab07a61-1c6b-4e7a-bdf6-47060f4d2fa5</guid><dc:creator>jostar</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Thanks for your help, if&amp;nbsp;there exist any way&amp;nbsp;to modify the&amp;nbsp;&lt;span&gt;ManufacturerName and ModelIdentifier attributes without rebuild the src code and flash to the nrf52840?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regard~&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I modify nrf52840 manufacturer ID and model ID by using "flash write" command in shell sample?</title><link>https://devzone.nordicsemi.com/thread/486651?ContentTypeID=1</link><pubDate>Thu, 30 May 2024 11:44:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d845dbb8-7c62-45c7-8791-12c902e3f60f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi jostar,&lt;/p&gt;
&lt;p&gt;The Shell sample only has the mandatory attributes of the Basic cluster (ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST and not ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT).&lt;br /&gt;ManufacturerName and ModelIdentifier attributes are optional and only included if you use the extended list, so you will have to modify the Shell sample.&lt;/p&gt;
&lt;p&gt;Using flash write would be tricky because you will&amp;nbsp;have to find where these attributes are stored. It&amp;#39;s much easier just to modify it in the code itself (from the light bulb sample):&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ZB_ZCL_SET_STRING_VAL(&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dev_ctx.basic_attr.mf_name,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BULB_INIT_BASIC_MANUF_NAME,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZB_ZCL_STRING_CONST_SIZE(BULB_INIT_BASIC_MANUF_NAME));&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ZB_ZCL_SET_STRING_VAL(&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dev_ctx.basic_attr.model_id,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BULB_INIT_BASIC_MODEL_ID,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZB_ZCL_STRING_CONST_SIZE(BULB_INIT_BASIC_MODEL_ID));&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>