Skip to main content

How to remain MAC address after SUOTA

4 years ago

How to remain MAC address after SUOTA

Posted byfn6540 points 8 replies
0 upvotes

I don"t want to change my deivce mac address after SUOTA.so how to remain MAC address after SUOTA.
Thanks

4 years ago

Gongyu_Dialog -15年效果ts

Whether the mac address is changed or not, depends on the nvds part of your new image.

Generally, the address will not be changed.

4 years ago

fn654 0 points

I have a new image to update,but some device need to be updated, I don"t want to change these device mac address to the nvds part of your new image. How can i confirm these device remaining mac address in accordance with the old imige .Is there a good way to do this?
thanks

4 years ago

Gongyu_Dialog -15年效果ts

in my opinion, after suota application is finished, but before software reset. You may add some code to copy original address to the new image address part stored in flash. Also may need to recalculate the crc value.

original address can be obtained in registers 0x40000024 and 0x40000028. Or directly get from variable "dev_bdaddr"

4 years ago

fn654 0 points

Hi
There is two questions confuse me .
Firstly, According to your method,I watch the variable "dev_bdaddr"at nvds.c.but i just get a array filled with 0.What's wrong with it?
In addition,do the address from 0x40000024 to 0x40000028 in flash store mac address ?and how can I operate the flash like writing and reading ? Do it has any decument to guide me?
thanks very much

4 years ago

Gongyu_Dialog -15年效果ts

yes, the value of "dev_bdaddr" is all 0, if there is no otp involved.

The address register: 0x40000024 (4 bytes) and 0x40000028(only lower 2 bytes).

if you store the address in OTP, suota upgrade will not overwrite the address.

But if you only use flash nvds part. it is quite difficult. I still need time to think about it.

4 years ago

Gongyu_Dialog -15年效果ts

if there is no otp involved, you need to modify the function “custom_nvds_get_func”, to get the address not from nvds part, but from your custom defined position in external flash.

In your new image code, it get the original device address from (0x40000024/0x40000028), and store the address in your custom defined position in external flash..

4 years ago

fn654 0 points

Hi
can i store mac address in OTP and use it while my device boot up form flash?
thanks

4 years ago

MT_dialog -30 points

Hi fn654,

Yes you can. The SDK first checks the OTP header (Device unique ID field) for a bd address and if there is a valid bd address in the OTP it uses it, else it uses the address that is defined in the source code.

Thanks MT_dialog