Other Parts Discussed in Thread: CC3100
hi
is there an API to read the MAC address from the cc3100 ? can I assume that each part will have a unique address ?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Other Parts Discussed in Thread: CC3100
hi
is there an API to read the MAC address from the cc3100 ? can I assume that each part will have a unique address ?
Hi Ron,
You can use the following code to get the MAC address for device.
unsigned char macAddressVal[SL_MAC_ADDR_LEN];
unsigned char macAddressLen = SL_MAC_ADDR_LEN;
sl_NetCfgGet(SL_MAC_ADDRESS_GET,NULL,&macAddressLen,(unsigned char *)macAddressVal);
Yes, all the shipped bards have a unique MAC address.
Regards,
Ankur
Hi Ankur
From some reason the call to sl_NetCfgGet above returns -2001, although the value in macAddressVal seems to bevalid. According to the doc it should return zero on success. I am working with 3100, SDK 5.2.
Regards,
Michael
Hi Michael,
I am able to reproduce the issue. I will check further on this and update here.
Regards,
Ankur
Hi Michael,
The Error -2001 is received when the RX buffer is less then the received data.
While getting the MAC address the network processor sends the 8 bytes but the request was for 6 bytes (size of MAC) and the result is trimmed to 6 bytes.
For this particular case the return value of -2001 can be ignored.
Regards,
Ankur
Is there a plan to fix this? Or maybe adjust the value of SL_MAC_ADDR_LEN from 6 to 8 so the return value when requesting SL_MAC_ADDR_LEN bytes returns "success"?
This code...
long slResult; unsigned char macAddr[SL_MAC_ADDR_LEN]; unsigned char macAddrLen = SL_MAC_ADDR_LEN; slResult = sl_NetCfgGet(SL_MAC_ADDRESS_GET, NULL, &macAddrLen, macAddr); /* slResult is incorrectly -2001 */
... is much more natural (and correct, IMHO) than this code...
long slResult; unsigned char macAddr[SL_MAC_ADDR_LEN + 2]; /* crazy bug */ unsigned char macAddrLen = SL_MAC_ADDR_LEN + 2; slResult = sl_NetCfgGet(SL_MAC_ADDRESS_GET, NULL, &macAddrLen, macAddr); /* slResult is now correctly 0 */
Chris
Hi,
I have a same problem like Harel. Program fail on call VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetCfgGetCmdCtrl, &Msg, &CmdExt));. I realised that problem start with call _SlDrvCmdOp(). Any answer?
Thanks
Hello,
I was about to ask this same question and I see an answer: "Yes, all the shipped bards have a unique MAC address."
I just want to ask for clarity. Are you saying that only "boards" come with a MAC address (like the EVMs) or do the raw chips themselves come pre-flashed/etched with an address? If I were to order 1000 bare chips, am I going to need to apply for an address range for our company? If every chip has a unique address already, is it read only so that someone couldn't accidentally wreck it during development?
Thanks!
Michael