<?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>samples/wifi/scan broken without programmed OTP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103719/samples-wifi-scan-broken-without-programmed-otp</link><description>The WiFi scan sample is currently broken is several ways when the OTP isn &amp;#39;t programmed : https://github.com/nrfconnect/sdk-nrf/blob/ea31b211be92f0f837cec1a70be665ec6ff712c3/samples/wifi/scan/src/main.c#L297 
 * net _if _down ( ) fails with -EAGAIN because</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Sep 2023 14:20:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103719/samples-wifi-scan-broken-without-programmed-otp" /><item><title>RE: samples/wifi/scan broken without programmed OTP</title><link>https://devzone.nordicsemi.com/thread/446096?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2023 14:20:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46c74ed5-afd9-4530-88cd-35445a0c82dc</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Ah, okay. Sorry about the misunderstanding. I have reported this internally now, but if you want to set your MAC address manually without writing a MAC address onto the OTP memory, you can add the following to your main file (where the code snippet goes into the beginning of your main loop.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/net/ethernet_mgmt.h&amp;gt;
#include &amp;lt;zephyr/net/ethernet.h&amp;gt;

		struct net_if *iface = net_if_get_default();
	char mac_addr_change[]={0x12, 0x34, 0x56, 0x78, 0x90, 0x12};
	struct ethernet_req_params params;
	int ret;

	memcpy(params.mac_address.addr, mac_addr_change, 6);
	net_if_down(iface);

	ret = net_mgmt(NET_REQUEST_ETHERNET_SET_MAC_ADDRESS, iface,
			&amp;amp;params, sizeof(struct ethernet_req_params));
	if(ret != 0) {
		LOG_ERR(&amp;quot;unable to change mac address&amp;quot;);
		return;
	}
	ret = memcmp(net_if_get_link_addr(iface)-&amp;gt;addr, mac_addr_change,
			sizeof(mac_addr_change));
	if(ret != 0) {
		LOG_ERR(&amp;quot;mac address change failed&amp;quot;);
		return;
	}
	LOG_DBG(&amp;quot;MAC changed to %x:%x:%x:%x:%x:%x\n&amp;quot;, \
	mac_addr_change[0], mac_addr_change[1], mac_addr_change[2], \
	mac_addr_change[3], mac_addr_change[4], mac_addr_change[5]);
	net_if_up(iface);

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: samples/wifi/scan broken without programmed OTP</title><link>https://devzone.nordicsemi.com/thread/445804?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 10:17:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a714e49-7baa-4d68-930b-c759b55a247a</guid><dc:creator>JordanYates</dc:creator><description>&lt;p&gt;I am not asking how to configure the OTP, I am notifying you that the sample is incorrect when it is not programmed.&lt;/p&gt;
&lt;p&gt;Explicitly because the sample is attempting to handle that case, and failing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: samples/wifi/scan broken without programmed OTP</title><link>https://devzone.nordicsemi.com/thread/445799?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 10:03:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b024880d-57dd-4513-ac99-87cb43d06ed7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Our devices are shipped with the OTP memory access in the disabled state, so some steps are necessary to enable write/read access of the OTP, and to let you I.E. write a MAC address onto the nRF7002. This is described in this application note under OTP memory programming.&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;The following steps are required:&lt;/p&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Set the protection registers (REGION.PROTECT[0..3]) to&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;0x50FA50FA&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to enable read/write access of the remaining OTP memory locations with the Wi-Fi Radio test command&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;wifi_radio_ficr_prog otp_write_params 0x100 0x50FA50FA&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Reboot the device to finish enabling read/write access to the OTP memory.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Update the OTP memory registers described in various steps in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a title="This section provides a summary of recommended and optional steps." href="https://infocenter.nordicsemi.com/topic/nan_043/APP/nan_043/production_line.html"&gt;Production line operations&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Set the OTP memory to protected state with the Wi-Fi Radio test command&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;wifi_radio_ficr_prog otp_write_params 0x100 0x00000000&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>