How to configure nrf7002's MAC manually

I am trying to use nrf7002 in accord with nrf52840 to build a wifi sniffer recently. As a begineer of nrf70 series, I use wifi sample supplied in ncs 2.4.0 as a start, which is the "shell" sample. After programming sample app to nrf52840. I got some error form console like down below.

------------------------------------------------------------log from console------------------------------------------------------------

00> rtt:~$ [00:00:00.297,058] <inf> wifi_nrf: SPIM spi@4002f000: freq = 8 MHz
00>
00> rtt:~$ [00:00:00.297,088] <inf> wifi_nrf: SPIM spi@4002f000: latency = 0
00>
00> rtt:~$ [00:00:00.375,213] <inf> wifi_nrf: Firmware (v1.2.8.1) booted successfully
00>
00> rtt:~$ [00:00:00.403,717] <inf> wifi_nrf: wifi_nrf_fmac_otp_mac_addr_get: Invalid OTP MAC addr: 000000000000
00>
00> rtt:~$ [00:00:00.404,022] <err> wifi_nrf: wifi_nrf_if_start_zep: Invalid MAC address: 00:00:00:00:00:00
00>
00> rtt:~$ [00:00:00.409,149] <inf> fs_nvs: 8 Sectors of 4096 bytes
00> rtt:~$ [00:00:00.409,149] <inf> fs_nvs: alloc wra: 0, fe8
00> rtt:~$ [00:00:00.409,179] <inf> fs_nvs: data wra: 0, 0
00> rtt:~$ *** Booting Zephyr OS build v3.3.99-ncs1 ***
00> rtt:~$ Starting nrf52840dk_nrf52840 with CPU frequency: 64 MHz
00> rtt:~$ [00:00:00.409,790] <inf> wpa_supp: Successfully initialized wpa_supplicant

------------------------------------------------------------log from console------------------------------------------------------------


According error msg, I found a related ticket How to avoid the use of OTP memory in the nrf7002

 My first question, it seems that nrf7002's OTP need to be pre-programmed berfore using the wi-fi stack. However, I had buy a nrf7002DK that can directly run the sample mentioned above. If that means nrf7002 on the nrf7002DK, whose OTP had been pre-programmed when production? 

Anther question is, what if I prefer not to pre-programmed OTP but provide the MAC manually instead. From the application note down below, there indeed exist a way to set MAC manually but not mentioned in detail. If there has any example or guideline about it?

  

 Device Commissioning and Characterization application note

Parents Reply
  • Use C:\ncs\v2.x.x\nrf\samples\wifi\radio_test

    step 1. Give following cmd to check spi communication b/w host and nRF700x
    cmd 1 -> wifi_radio_ficr_prog

    step 2. Use following cmd to get write access
    cmd 2 -> wifi_radio_ficr_prog otp_write_params 0x100 0x50FA50FA

    step 3. Use following cmd to write your own mac address
    cmd 3 -> wifi_radio_ficr_prog otp_write_params 0x120 0xA1B2C3D4 0x1111

    step 4. you should reset the device after given cmd 3

    step 5. Use following cmd to check succesfully the mac address writtern or not
    cmd 4 -> wifi_radio_ficr_prog otp_get_status

Children
No Data
Related