How to remain MAC address after SUOTA

9 posts / 0 new
Last post
fn654
Offline
Last seen:1 year 10 months ago
Joined:2016-06-14 13:27
How to remain MAC address after SUOTA

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

Device:
Gongyu_Dialog
Offline
Last seen:5 hours 36 min ago
Joined:2016-04-27 07:07
Whether the mac address is

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

Generally, the address will not be changed.

fn654
Offline
Last seen:1 year 10 months ago
Joined:2016-06-14 13:27
I have a new image to update

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

Gongyu_Dialog
Offline
Last seen:5 hours 36 min ago
Joined:2016-04-27 07:07
in my opinion, after suota

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"

fn654
Offline
Last seen:1 year 10 months ago
Joined:2016-06-14 13:27
Hi

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

Gongyu_Dialog
Offline
Last seen:5 hours 36 min ago
Joined:2016-04-27 07:07
yes, the value of "dev_bdaddr

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.

Gongyu_Dialog
Offline
Last seen:5 hours 36 min ago
Joined:2016-04-27 07:07
if there is no otp involved,

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..

fn654
Offline
Last seen:1 year 10 months ago
Joined:2016-06-14 13:27
Hi

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

MT_dialog
Offline
Last seen:2 months 6 days ago
Staff
Joined:2015-06-08 11:34
Hi fn654,

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