How do I read the MAC address of my WICED Wi-Fi device?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
How do I read the MAC address of my WICED Wi-Fi device?
0 Likes
4 Replies
Anonymous
Not applicable
[applicable to SDK-2.x onwards]

Information about the MAC address of the Wi-Fi device is here <WICED-SDK>/generated_mac_address.txt file.

This file is auto-generated upon building a target.

/*

* The MAC address of the Wi-Fi device may be configured in one of several places :                               

* 1. WLAN OTP   : The MAC address may be factory programmed into read-only OTP inside the Wi-Fi chip.            

*                                                                                                                

*                 directly into the application (which may be common to many devices).                           

*                                                                                                                

*      or         To force the WLAN chip to use the MAC addressed stored in the DCT, simply define               

*    Custom       a global variable in your application makefile as shown below.                                 

*                 In <WICED-SDK>/App/my_app/my_app.mk add the following global define :                          

*                    GLOBAL_DEFINES := MAC_ADDRESS_SET_BY_HOST                                                      

*                                                                                                                

*                 To force the WLAN chip to use a custom MAC address (instead of the MAC address                 

*                 in the DCT), simply redefine the host_platform_get_mac_address() function located in the file: 

*                 <WICED-SDK>/Wiced/Platform/common/<MCU_ARCHITECTURE>/<MCU_PN>/<MCU_PN>_platform.c              

*/

To read the mac address, use the API call : wiced_wifi_get_mac_addr().

This is actually a lower-layer WWD (WICED Wi-Fi Driver) API, but is also available to customers.

(We will expose this API in the high layer WICED API in a future version of the SDK)
0 Likes
Anonymous
Not applicable

Hi

  Does it work with BCM4390 and SDK 1.3.1 ? 

  I have problem with BCM4390 and have some of compilation error

Error console :

build/demo_appliance-BCM94390WCD2/libraries/WWD_for_SoC_4390_ThreadX.a(wwd_management.o): In function `wwd_management_wifi_on':

Region SRAM_128k_1 overflowed as requested from .text_128k_area1 into .text_128k_area2 - current size 130672, size limit 131072, tried to add 616 bytes

C:\Users\damosys\Documents\WICED\WICED-SDK-3.1.1\Wiced-SDK/WICED/WWD/internal/wwd_management.c:155: undefined reference to `host_platform_get_mac_address'

tools/makefiles/wiced_elf.mk:215: recipe for target 'build/demo_appliance-BCM94390WCD2/binary/demo_appliance-BCM94390WCD2.elf' failed

make.exe[1]: *** [build/demo_appliance-BCM94390WCD2/binary/demo_appliance-BCM94390WCD2.elf] Error 1

// I put the thread as below

Please refer   GLOBAL_DEFINES += MAC_ADDRESS_SET_BY_HOST make problem at BCM4390WCD2 

0 Likes

After reading this, discovered the function name is actually:

wiced_wifi_get_mac_address(), not wiced_wifi_get_mac_addr().

And the GLOBAL_DEFINES is not required for reading the mac address, perhaps it is for setting it.

0 Likes
Anonymous
Not applicable

If you do it with WiConnect; it is a single line...

get wl m

(as in get wlan mac)

here is a screen shot from my console

getwlm.png