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
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"
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
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..
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.
是否成r the mac address is changed or not, depends on the nvds part of your new image.
Generally, the address will not be changed.
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
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"
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
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.
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..
Hi
can i store mac address in OTP and use it while my device boot up form flash?
thanks
嗨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