Write MAC to OTP over RTT

I have a custom board with the nRF9160 and nRF7200 connected.

I was able to build the radio_test sample to check if everything is working, and for now, it seems to be fine. Here are the PHY stats:

************* PHY STATS ***********
rssi_avg = -86 dBm
ofdm_crc32_pass_cnt=0
ofdm_crc32_fail_cnt=2
dsss_crc32_pass_cnt=2
dsss_crc32_fail_cnt=0

Next, I tried to program the MAC using this command:

wifi_radio_ficr_prog otp_write_params 0x120 arg1=0x23f4a7f8 arg2=0x06ce

However, I got the following errors:

rtt:~$ wifi_radio_ficr_prog otp_write_params 0x120 arg1=0x23f4a7f8 arg2=0x06ce
OTP Region is open for R/W

Invalid MAC address. MAC address cannot be all 0's, broadcast or multicast address
rtt:~$ wifi_radio_ficr_prog otp_write_params 0x120 arg1=0x23F4A7F8 arg2=0x06CE
OTP Region is open for R/W

Invalid MAC address. MAC address cannot be all 0's, broadcast or multicast address

After that, I tried writing a command to unlock the OTP:

wifi_radio_ficr_prog otp_write_params 0x100 arg=0x50FA50FA

Unfortunately, the issue now is that it writes 0 to all the registers and locks the OTP. The output shows:

rtt:~$ wifi_radio_ficr_prog otp_write_params 0x100 arg=0x50FA50FA
OTP Region is open for R/W

Finished Writing OTP params
rtt:~$ [00:48:13.181,640] <inf> otp_prog: Written REGION_PROTECT0 (0x100) : 0x0000
rtt:~$ [00:48:13.181,671] <inf> otp_prog: Written REGION_PROTECT1 (0x104) : 0x0000
rtt:~$ [00:48:13.181,671] <inf> otp_prog: Written REGION_PROTECT2 (0x108) : 0x0000
rtt:~$ [00:48:13.181,671] <inf> otp_prog: Written REGION_PROTECT3 (0x10c) : 0x0000
rtt:~$ rtt:~$ wifi_radio_ficr_prog otp_write_params 0x120 arg1=0x23f4a7f8 arg2=0x06ce
OTP Region is locked!!!

USER Region is not Writeable

I am now unable to unlock the chip because all the arguments are being sent as 0, no matter what I try to write.

I also tried this commands:

wifi_radio_ficr_prog otp_write_params 0x100 arg=0x50FA50FA

wifi_radio_ficr_prog otp_write_params 0x100 arg='0x50FA50FA'

wifi_radio_ficr_prog otp_write_params 0x100 0x50FA50FA

wifi_radio_ficr_prog otp_write_params 0x100 1358582010



For me the issue is that arg always equal to 0 if I send them over RTT.
For sending I use the J-Link RTT Viewer V7.94e

Parents
  • Hello,

    The arguments should be passed like this: 'wifi_radio_ficr_prog otp_write_params 0x120 0x23f4a7f8 0x06ce', without 'arg1=' and 'arg2='. I see that the protection bits were set after you ran the 'wifi_radio_ficr_prog otp_write_params 0x100 arg=0x50FA50FA' command, which unfortunately means the FICR can no longer be updated. Do you have another board you can test this on? Also, which SDK version are you on?

    Best regards,

    Vidar

Reply
  • Hello,

    The arguments should be passed like this: 'wifi_radio_ficr_prog otp_write_params 0x120 0x23f4a7f8 0x06ce', without 'arg1=' and 'arg2='. I see that the protection bits were set after you ran the 'wifi_radio_ficr_prog otp_write_params 0x100 arg=0x50FA50FA' command, which unfortunately means the FICR can no longer be updated. Do you have another board you can test this on? Also, which SDK version are you on?

    Best regards,

    Vidar

Children
  • Hi  

    Thanks, I already figure out that I did send command in the wrong order. Fortunately, I ordered 3 boards and blocked only one of them.

    As I understand there's a way to set MAC from the firmware and not from the OTP as now I have only 0s there and it will not work. By the way we will use nRF7200 only for scan and WIFI location does it also require the MAC address? 

    I am using SDK 2.6.1

  • Hi,

    Roman Veselskyi said:
    As I understand there's a way to set MAC from the firmware and not from the OTP as now I have only 0s there and it will not work.

    There is the CONFIG_WIFI_FIXED_MAC_ADDRESS Kconfig symbol that you can use to override the MAC address stored in OTP. However, this is intended only for testing purposes.

    Only passive scanning is used for Wi-Fi locationing, so the MAC address will not be transmitted.

    Best regards,

    Vidar

  •   thanks,

    I have 1 more question regarding the MAC write operation.

    I tried to use the next MAC f2:01:d5:50:6f:52

    This is the command I send over RTT

     wifi_radio_ficr_prog otp_write_params 0x120 0x50d501f2 0x526f

    But when I read values, I see that it shows another MAC
    MAC0.ADDRESS = f0:01:d4:00:4e:02

    rtt:~$ rtt:~$ wifi_radio_ficr_prog otp_write_params 0x120 0x50d501f2 0x526f
    OTP Region is open for R/W
    
    Finished Writing OTP params
    rtt:~$ [00:22:05.303,131] <inf> otp_prog: mac addr 0 : Reg1 (0x120) = 0x50d501f2
    rtt:~$ [00:22:05.303,741] <inf> otp_prog: mac addr 0 : Reg2 (0x124) = 0x526f
    rtt:~$ [00:22:05.304,077] <inf> otp_prog: Written MAC address 0
    rtt:~$ [00:22:05.304,077] <inf> otp_prog: Written REGION_DEFAULTS (0x154) : 0xfffffffd
    rtt:~$ rtt:~$ wifi_radio_ficr_prog otp_read_params
    OTP Region is open for R/W
    
    ...
    
    MAC0.ADDRESS0 = 0x00d401f0
    MAC0.ADDRESS1 = 0x0000024e
    MAC0.ADDRESS = f0:01:d4:00:4e:02
    
    MAC1.ADDRESS0 = 0xffffffff
    MAC1.ADDRESS1 = 0xffffffff
    MAC1.ADDRESS = ff:ff:ff:ff:ff:ff
    
    CALIB.XO = 0xff
    REGION_DEFAULTS = 0xfffffffd
    
    rtt:~$ 

  • The registers are one-time programmable, so they can't be written to more than once. You can try writing this address to the second MAC address register.

Related