otp mac address in nrf7002 can not be changed by wifi_radio_ficr_prog

Hi,

Something I missed, please help me to understand.

When I use the radio_test sample t rogramm the mac address in otp memory of the nrf7002 I had this :

You can see  that  mac address 7F:FF:EE:FF:EE:FF is not possible, but if I change one bit 7E:FF:EE:FF:EE:FF it is possible, the error message got some modifications to display arg1 and its equivalent in long int, I also display the first byte of the mac address (wich is the last byte in arg1)

The modificaiton I made to see what is write_val[0]

write_val[0] = strtoul(argv[2], NULL, 0);
		write_val[1] = strtoul(argv[3], NULL, 0) & 0xFFFF;

		if (!nrf_wifi_utils_is_mac_addr_valid((const char *)write_val)) {
			shell_fprintf(shell,
				      SHELL_ERROR,
				      "Invalid MAC address: %s , translated : %d. MAC address cannot be all 0's, broadcast or multicast address\n", argv[2], write_val[0]);
			shell_fprintf(shell,
				      SHELL_ERROR,
				      "mac_addr: %d\n", ((char *)write_val)[0]);		  
			return -ENOEXEC;
		}

		write_otp_memory(field, &write_val[0]);
		break;

The nrf_wifi_utils_is_mac_addr_valid function is in util.c

bool nrf_wifi_utils_is_mac_addr_valid(const char *mac_addr)
{
	unsigned char zero_addr[NRF_WIFI_ETH_ADDR_LEN] = {0};

	return ((memcmp(mac_addr,
			zero_addr,
			sizeof(zero_addr)) != 0) &&
		!(mac_addr[0] & 0x1));
}

Why the nrf_wifi_utils_is_mac_addr_valid function imposes that the mac address has to have the low bit of the first byte to 0 ?

Related