14 posts / 0 new
Last post
dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
Suota Scheme 2

Hi Dialog,
I am using Scheme 1 for upgrading firmware on DA14583 using Suota as specified in AN-B-010 note and Training6 suota_example.I now want to encrypt the image and store the secondary bootloader in OTP. So,I just want to ask if we can use Scheme 2 for DA14583 device programming.If yes , where will I find the steps to write only Secondary Bootloader in OTP while my firmware images will stay in flash?

Device:
MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

The 583 has allready its OTP burned but there is an option to burn the advanced bootloader, so theoretically you can use the Secondary bootloader as a SUOTA bootloader and burn the rest of the 583 OTP image with that bootloader (since the 583 has different default pins for the internal flash you need to configure the S. bootloader to use them). In that case the OTP will load the 583 bootloader, and when the 583 bootloader will run on the sysram it wil check if there is an advanced bootloader in the OTP (the description of the 583 bootloader is described in document UM-B-012) and will load the multipart bootloader from the OTP. So since you have burned the Secondary bootloader this is what is going to be loaded from the 583. Now since the 583 has an embedded flash, the scheme that you have requested is not tested, or recommended, since you can have your secondary bootloader to your flash and not in OTP, so there is no documentation or a tutorial how to do this on a 583.

Thanks MT_dialog

dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
hi MT_Dialog,

hi MT_Dialog,
though 583 has embedded flash it can be read by an external device , so for protecting my firmware I aim for implementing new scheme. I am presently using SUOTA multipart binary scheme, wherein my advance bootloader and encrypted images are in flash which can be read by external device.So I want to ask If I can store encryption key in OTP and advance bootloader would read the encryption key from otp?
Thanks,
dhiraj

MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp,

Hi dhirajp,

Well i dont see anything wrong in doing that, although we haven't tested a scheme like this, your scenario seems plausible.

Thanks MT_dialog

dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
Hi MT_Dialog,

Hi MT_Dialog,
Is there a method to initialize, read and write to OTP memory? I can flash the key from smartsnippets OTP programmer , but whats the way to read the key inprogram?
Thanks Dhiraj

MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp,

Hi dhirajp,

When the 580 starts up it checks the OTP for an available bd address, i suppose that you can modify this function with a different address in order to read other fields of the OTP as well. You will be able to find the function in the SDK in the nvds_read_bdaddr_from_otp() and read the corresponding address.

Thanks MT_dialog

dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
Hi MT_Dialog,

Hi MT_Dialog,
Thanks for the help!
我们正在使用583数据点服务设备, we want to store some private information which will never change in future and should not be rewrittable , so we plan to store it in otp, I am able to read data from otp as you suggested , but to write to otp there are three ways in otp programmer, 1.otp header,2.otp nvds, 3.otp image , i have 32bytes of data to be written in otp , which way should I use?
Thanks dhiraj

MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

The OTP image placeholder is just for the image that is going to be uploaded into the 580 and the OTP NVDS is just a reserved place in the image it self that is used for the predefined reasons, bluetooth address, etc. You can either place the data that you would like in the code itself or you could use the custom fields in the OTP header. The customer specific fields of the OTP span from the address 0x7F10 to 0x7F60.

Thanks MT_dialog

dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
Hi MT_dialog,

Hi MT_dialog,
I made the changes in custom fields in default otp header also set the address field of advance bootloader for future use and burnt it , now I if I write a code to read the data from otp and run it in debug mode , it works! But If I flash the image in SPI Flash it does'nt work.Is it because I have burnt the otp header so now onward it will boot only from otp? do I need to place advance bootloader in otp ? Current my advance bootloader is in SPI flash and I am using multipart binary with suota enabled.
PFA the otp_header.hex
My aim is to keep advance bootloader in flash so that it can be changed in future, also I want to keep some permanent private data in OTP memory.
Thanks dhiraj

Attachment:
MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

I assume that "it doens't work from flash" means that you are not able to boot from flash ? I dont think that the fact that you can't boot from flash has to do with the fact that you ve burned the OTP. On the 583 the OTP is allready burned with the 583 bootloader and the application flags as well so that the 583 to be able to boot from its internal flash. Is the advanced bootloader running when the system boots ?

Thanks MT_dialog

dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
Hi MT_Dialog,

Hi MT_Dialog,
Yes I am not able to boot from flash, and how to detect if advance bootloader is running? Also I have attached the otp header file in previous comment, there i had set the address for advance bootloader as 0x2000,so that I could flash the advance bootloader if required in future, but now it is not allowing me to burn the bootloader in otp and if i keep advance bootloader in flash , the device doesnt boot.
Thanks,
dhiraj

MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

Since you are not booting the advanced bootloader from the OTP but from flash you should not specify in the OTP that there is an advanced bootloader in the OTP. You should let the 583 bootloader to run and boot from the flash (perform the scanning procedure and boot normally from flash the secondary bootloader). From there it will load the secondary bootloader and then your image will be loaded. Please check the UM-B-012 Creation of a secondary boot loader 3.0.pdf at section 5.1. With the configuration you have on the OTP header, the 583 bootloader sees that the 0x7F10 address has a value and tries to copy what is written at that address from the OTP and offcourse the OTP at that point is blank since you have not burned the bootloader.

Thanks MT_dialog

dhirajp15
Offline
Last seen:1 year 10 months ago
Joined:2016-06-08 15:26
Hi MT_Dialog,

Hi MT_Dialog,
I again flashed the otp header keeping the advance bootloader address as default and it worked.
Thanks for the help.
Regards,
dhiraj

MT_dialog
Offline
Last seen:7 hours 50 min ago
Staff
Joined:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

Glad you could make it work, If any of the above posts have helped, please mark them as accepted.

Thanks MT_dialog