<?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>Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120365/central-mode-get-wrong-device-mac-address</link><description>SDK:nRF5_SDK_17.1.0_ddde560 
 example: ble_app_multilink_central 
 softdevice: s140_nrf52_7.2.0 
 PCB: PCA10059 as Cental 
 My peripheral device&amp;#39;s mac is 00:96:81:16:E0:9F (checked by pc software and device self printf) 
 But when i print p_gap_evt-&amp;gt;params</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Apr 2025 08:49:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120365/central-mode-get-wrong-device-mac-address" /><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530398?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 08:49:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0529604f-d166-4086-8cb8-535f2fb1f8df</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Yes~ I change&amp;nbsp;&lt;span&gt;adv_report to connected and get the correct mac addr now!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you~ really appreciate it &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530392?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 08:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37e707db-bf1e-45d4-966f-7b9e12e93bfb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think I spotted the error now. Unions are a bit tricky as the&amp;nbsp;member in the union is decided runtime, so you will not get a build error when using the wrong union member. And here you are using the adv_report in the handling of the&amp;nbsp;BLE_GAP_EVT_CONNECTED event, which is incorrect. You need to use the connected union member. So it should be something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;            NRF_LOG_INFO(&amp;quot;MAC %02X:%02X:%02X:%02X:%02X:%02X \r\n&amp;quot;,
                    p_gap_evt-&amp;gt;params.connected.peer_addr.addr[0],
                    p_gap_evt-&amp;gt;params.connected.peer_addr.addr[1],
                    p_gap_evt-&amp;gt;params.connected.peer_addr.addr[2],
                    p_gap_evt-&amp;gt;params.connected.peer_addr.addr[3],
                    p_gap_evt-&amp;gt;params.connected.peer_addr.addr[4],
                    p_gap_evt-&amp;gt;params.connected.peer_addr.addr[5]);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530201?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 10:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed254001-059a-46e8-8d99-3163434c9355</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried SES V5.42a, and got same result as keil.&lt;/p&gt;
&lt;p&gt;I only change&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;m_target_periph_name&lt;/li&gt;
&lt;li&gt;Add NRF_LOG_INFO(&amp;quot;MAC %02X:%02X:%02X:%02X:%02X:%02X \r\n&amp;quot;, p_gap_evt-&amp;gt;params.adv_report.peer_addr.addr[0], at case BLE_GAP_EVT_CONNECTED:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also tested nRF5_SDK_16.0.0_98a08e2 with&amp;nbsp;s140_nrf52_7.0.1_softdevice.hex, still the same.&lt;/p&gt;
&lt;p&gt;Any idea? or anything want to try?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743589339187v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743589240646v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743589258097v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743589303153v3.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530192?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 09:59:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32477f05-52a0-4104-83ca-34204e031ed2</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Stack_Size&amp;nbsp; &amp;nbsp; &amp;nbsp; EQU 16384 add to 32768 doesn&amp;#39;t help. Still get wrong mac.&lt;/p&gt;
&lt;p&gt;I will come back after try&amp;nbsp;&lt;span&gt;Segger Embedded Studio version&amp;nbsp;5.42a.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530179?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 09:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f874bf3-a8e8-4bb7-b3dc-e52ac6a42b31</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. In Keil projects, the easiest way to adjust the stack size is to modify&amp;nbsp;modules/nrfx/mdk/arm_startup_nrf52840.s and where you have a line starting with &amp;quot;&lt;code&gt;Stack_Size EQU&lt;/code&gt;&amp;quot;, modify the number to a higher value. Alternatively, it should work to go to&amp;nbsp;Options for Target -&amp;gt; C/C++ -&amp;gt; Preprocessor Symbols&amp;nbsp; and define&amp;nbsp;&lt;code&gt;__STACK_SIZE&lt;/code&gt; to the value you want. (The stack size may not be the issue here, but it is worth increasing it to check).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530177?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 09:05:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:250a9a31-e15c-431f-a24c-d53af5a4b40a</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which version of Keil are you using?
&lt;ul&gt;
&lt;li&gt;uVision 5.28&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Do you only see this with optimization level 0?
&lt;ul&gt;
&lt;li&gt;debug mode only work well with level 0. I tried level 3 and print mac to usb, still got wrong mac as level 0.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Can you build the project with Segger Embedded Studio version&amp;nbsp;5.42a (this is the version used with the nRF5 SDK 17.1.0 release test) to see if you can reproduce the issue there?
&lt;ul&gt;
&lt;li&gt;This need take some time to get everything work, will try it next few days.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I assume you are using an external debugger as the nRF52840 dongle does not have an onboard debugger, or are you testing on a different board (the DK for instance)?
&lt;ul&gt;
&lt;li&gt;I connect PCA10059 with PCA10028 as picture.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span&gt;The backtround for these questions is that it the address type as well as the address are invalid, so I wonder if there could be a stack overflow or similar corrupting the memory. Can you try to increase the stack size and see if that helps?&lt;/span&gt;
&lt;ul&gt;
&lt;li&gt;How to increase stack size?&lt;/li&gt;
&lt;li&gt;Now my IRAM1: 0x200043A8&amp;nbsp;0x3BC58, I tried 0x20010000 0x30000 doesn&amp;#39;t help.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/IMG_5F00_1937.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743584686865v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530151?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 07:58:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4a066c1-973e-46d7-90ae-d5eff1713a70</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any issues in the code here or your changes. I notice you are using Keil which I have not been able to test, but I have some questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which version of Keil are you using?&lt;/li&gt;
&lt;li&gt;Do you only see this with optimization level 0?&lt;/li&gt;
&lt;li&gt;Can you build the project with Segger Embedded Studio version&amp;nbsp;5.42a (this is the version used with the nRF5 SDK 17.1.0 release test) to see if you can reproduce the issue there?&lt;/li&gt;
&lt;li&gt;I assume you are using an external debugger as the nRF52840 dongle does not have an onboard debugger, or are you testing on a different board (the DK for instance)?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The backtround for these questions is that it the address type as well as the address are invalid, so I wonder if there could be a stack overflow or similar corrupting the memory. Can you try to increase the stack size and see if that helps?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/530096?ContentTypeID=1</link><pubDate>Wed, 02 Apr 2025 02:49:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52445aaa-52e0-4872-98f1-297cbd34daeb</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi, thanks for reply. I did combine USB and LED fuction.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So I download and unzip&amp;nbsp;nRF5_SDK_17.1.0_ddde560.zip make sure all clean. And open&amp;nbsp;ble_app_multilink_central as attached file.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my change:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set Optimization to Level 0&lt;/li&gt;
&lt;li&gt;Change define BOARD_PCA10056 to&amp;nbsp;BOARD_PCA10059&lt;/li&gt;
&lt;li&gt;Change m_target_periph_name[] to my device name.&lt;/li&gt;
&lt;li&gt;Add&amp;nbsp;NRF_LOG_INFO(&amp;quot;MAC %02X:%02X:%02X:%02X:%02X:%02X \r\n&amp;quot;, p_gap_evt-&amp;gt;params.adv_report.peer_addr.addr[0], at&amp;nbsp;case BLE_GAP_EVT_CONNECTED:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Than I test 2 different devices, 1 is made with ST bluenrg-lp and the other is Nordic 52832.&lt;/p&gt;
&lt;p&gt;And still can&amp;#39;t get the correct mac address :(&lt;/p&gt;
&lt;p&gt;Any idea?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743562013223v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743562050470v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8688.ble_5F00_app_5F00_multilink_5F00_central.zip"&gt;devzone.nordicsemi.com/.../8688.ble_5F00_app_5F00_multilink_5F00_central.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central mode get wrong device mac address.</title><link>https://devzone.nordicsemi.com/thread/529994?ContentTypeID=1</link><pubDate>Tue, 01 Apr 2025 12:23:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35942fab-0dbc-4b9e-bfcf-b0901af00fac</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assum the peripheral is using a static address so that you know what to expect?&amp;nbsp;I notice that the addr_type value is invalid as well, so I wonder if something has corrupted this data somehow. Have you made any changes to the&amp;nbsp;ble_app_multilink_central example? Can you explain what those changes are? Are you ablet o reproduce this issue without your changes (if any)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>