Skip navigation
Home > All Places > WICED Studio Wi-Fi/Combo > WICED Studio Wi-Fi/Combo Forums > Blog > 2018 > September > 28

    SUMMARY:

    We shared four ways to set wifi mac address,  this blog is to show the process .

    Test is based on CYW954907AEVAL1F .

 

  • DCT  mode:
  1. Add define in app.mk: GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. 43xxx_Wi-Fi\generated_mac_address.txt

     Modify the address in the directory , it works.

     #define NVRAM_GENERATED_MAC_ADDRESS "macaddr=00:A0:50:38:f6:35"

     #define DCT_GENERATED_MAC_ADDRESS "\x00\xA0\x50\xe8\xf3\x48"

     #define DCT_GENERATED_ETHERNET_MAC_ADDRESS "\x00\xA0\x50\xe5\xf3\x47"

 

  • OTP mode
  1. Disable //GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. Need to clean the building, then make again.

 

    Starting WICED vWiced_006.002.001.0002

    Platform CYW954907AEVAL1F initialised

    Started ThreadX v5.8

    Initialising NetX_Duo v5.10_sp3

    Creating Packet pools

     WLAN MAC Address : B8:D7:AF:4D:1D:D6

     WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905

     WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15

 

  1. Let us to go to MFG mode to check the OTP area.

        Have a test with mfg mode:

       test.mfg_test-CYW954907AEVAL1F download download_apps run

  • Modify it in NVRAM:
  • 43xxx_Wi-Fi\platforms\CYW954907AEVAL1F\board_revision\P101

     static const char wifi_nvram_image[] =

      "sromrev=11" "\x00"

      "vendid=0x14e4"                                                      "\x00"

      "devid=0x43d0" "\x00"

      "macaddr=00:A0:50:38:f6:35" "\x00"

 

  1. Disable //GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. Do nothing, clean and build again.
  3. The mac address still is WLAN MAC Address : B8:D7:AF:4D:1D:D6

I do not find anywhere to fix the MAC address into nvram setting, so I presume OTP priority is higher than NVRAM,  if OTP existed the NVRAM mac address will be ignored .

 

 

  • CUSTOM MODE:
  1. Enable the define in app makefile: GLOBAL_DEFINES     += MAC_ADDRESS_SET_BY_HOST
  2. Modify the code, add simple test:
  3. 43xxx_Wi-Fi\WICED\platform\MCU\BCM4390x\

    4. bcm4390x_platform.c

wwd_result_t host_platform_get_mac_address( wiced_mac_t* mac )

{

#ifndef WICED_DISABLE_BOOTLOADER

    wiced_mac_t* temp_mac;

    wiced_result_t result;

    result = wiced_dct_read_lock( (void**)&temp_mac, WICED_FALSE, DCT_WIFI_CONFIG_SECTION, OFFSETOF(platform_dct_wifi_config_t, mac_address), sizeof(mac->octet) );

    if ( result != WICED_SUCCESS )

    {

        return (wwd_result_t) result;

    }

    memcpy( mac->octet, temp_mac, sizeof(mac->octet) );

       mac->octet[0]= 0x00;

       mac->octet[1]= 0x11;

       mac->octet[2]= 0x22;

       mac->octet[3]= 0x33;

       mac->octet[4]= 0x44;

       mac->octet[5]= 0x55;

    wiced_dct_read_unlock( temp_mac, WICED_FALSE );

#else

UNUSED_PARAMETER( mac );

#endif

    return WWD_SUCCESS;

}

 

Starting WICED vWiced_006.002.001.0002

Platform CYW954907AEVAL1F initialised

Started ThreadX v5.8

Initialising NetX_Duo v5.10_sp3

Creating Packet pools

WLAN MAC Address : 00:11:22:33:44:55

WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905

WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15

Console app

   We have different options in the command input line for setting a global define. Below topic is a simple explanation for these inputs.

Actually you can also get most of them from the  makefile.  We also provide examples after wiced studio installed.

 

  • snip.scan-BCM943362WCD4

        Build for release

 

  • snip.apsta-BCM943362WCD4-debug

       Keyword:debug,

       It means if you want to use Jtag or Jlink to have a debug, you need to add this option to get a debug image.

 

  • snip.apsta-BCM943340WCD1-FreeRTOS-LwIP download run

       Keyword : FreeRTOS-LwIP download run

It means use FreeRTOS system, LwIP network protocol and use the default USB-JTAG programming interface.

 

  • demo.aws_iot.shadow-BCM94343W_AVN download_apps download run

       Keyworddownload_apps

If you want to download app into external flash by using SFLASH_WRITER_APP, you need to enable this option.

 

  • snip.scan-BCM943362WCD4-FreeRTOS-LwIP-SDIO download run

        Keyword:  FreeRTOS-LwIP-SDIO

It means using FreeRTOS system, LwIP network protocol, SDIO interface for communication.

 

  • snip.scan-BCM943362WCD4-ThreadX-NetX_Duo-SDIO download run

        Keyword:  ThreadX-NetX_Duo-SDIO

It means using Threadx OS system, Netx network protocol, SDIO interface communication.

 

  • snip.scan-BCM943362WCD4-ThreadX-NetX-SPI download run

       Keyword:  ThreadX-NetX-SPI

It means using Threadx OS system, Netx network protocol, SPI communication interface.

 

  • test.wifi_join-CYW954907AEVAL1F VERBOSE=1 download run

       Keyword: VERBOSE=1

It means compile and download log will output with a more detailed logs.

 

we also have some other options like  [JTAG=xxx]  [no_dct] [JOBS=x] ,  below comments are important for input compile options:

  Notes

    * Component names are case sensitive

    * 'WICED', 'SDIO', 'SPI' and 'debug' are reserved component names

    * Component names MUST NOT include space or '-' characters

    * Building for release is assumed unless '-debug' is appended to the target

    * Some platforms may only support a single interface bus option

 

Below are instructions for OTA2, please refer to the document carefully .

 

Key words are:

//Build an OTA2 Update Image suitable for upgrade server:

ota2_image

ota2_download

 

//Build an OTA2 Factory Reset Image suitable for manufacturing FLASHing of the device:

ota2_factory_image

ota2_factory_download

 

//It includes waf/ota2_bootloader, OTA2_factory_reset_image.bin, waf/ota2_failsafe, DCT, Application LUT, ota2_extract, and the application

ota2_manuf_image

ota2_manuf_download

 

// Below is for secure flash and version management.

APP_VERSION_FOR_OTA2_MAJOR=1

APP_VERSION_FOR_OTA2_MINOR=3

SECURE_SFLASH=1

keys=<keys_dir>

 

//show update from version of the SDK.

UPDATE_FROM_SDK=<bootloader_sdk>

 

//There were optional structures in the System DCT that are now always included. They are the Bluetooth (BT), Peer to Peer (P2P) and Over The Air 2 (OTA2) sub-structures. This information must also be designated so that the code knows which (if any) of the optional structures were used in the original application build DCT.

APP_USED_BT=1

APP_USED_P2P=1

APP_USED_OTA2=1

 

reference:

WICED Over The Air (OTA) v2 Firmware update Users Guide

Filter Blog

By date:
By tag: