What is the right configuration for secure boot loader in OTP?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
Thomas Donhauser
Offline
Last seen:3 months 2 days ago
加入:2019-10-20 10:45
What is the right configuration for secure boot loader in OTP?

Hi PM_Dialog!

I need to develop an spezial OPT secure bootloader and don't know what the right config is. in ble_suota_loader the config is this:
#define dg_configEXEC_MODE MODE_IS_MIRRORED
#define dg_configCODE_LOCATION NON_VOLATILE_IS_NONE

But if I follow the the capture "3.4.3 BootROM sequence" in the documentation for da14683 the configuration may be also like this:

#define dg_configEXEC_MODE MODE_IS_CACHED
#define dg_configCODE_LOCATION NON_VOLATILE_IS_OTP

I've read the docs for- and backwards, but I did't come to any conclusion what the advantage or disadvantage is. All I know so far ist that the combination of MODE_IS_MIRRORED & NON_VOLATILE_IS_OTP did not work because my secure boot loader is bigger than 16K.

So my question is: What is the best choice?

Thank you,
Thomas

Device:
PM_Dialog
Offline
Last seen:2 days 8 hours ago
Staff
加入:2018-02-08 11:03
Hi Thomas,

Hi Thomas,

Let me check it and I'll get back to you.

In the meanwhile, have you checked the following tutorial?

http://lpccs-docs.dialog-semiconductor.com/da14683_secure_boot/index.html

Thanks, PM_Dialog

Thomas Donhauser
Offline
Last seen:3 months 2 days ago
加入:2019-10-20 10:45
Hello PM_Dialog,

Hello PM_Dialog,

Thank you for the answer. I know the document already. But as I mentioned, in non of the available docs is the low level stuff described how any of the high-level scripts work in details or what they do. However, of some reasons I have to programm my own secure bootloader that will be programmed later when there is no cli_programmer available. I'm allmost done with this. The last an only part is the question of the right memory and execurion configuration.

In general I think the da14683 is a phantastic SOC and I'm very happy to have choosen it. But all in all the documentation in case of the scripts, that come with Smart-Snipped Studio, is very poor. The way SUOTA works is predfined by the scripts and it is no obviously how it works. I spend days in debugging the tools like cli_programmer and mkimage to get a deeper understanding of what they do. For instance: bin2image makes different images for QSPI and OTP. I "guess" it has something to do with bootRom. But I have no clue what and why.

我学会了从debugging it. But I'd prefer to have a document that explains it. So time after time I get upset reading docs that show up screenshots of scripts to execute. This is definitly not what developers need. It's nice for those who want to play around in their hobby basement but totally insufficient for professionals.

My customer is a huge company and I can't tell them: "Look this is a cool script that does anything for you, but I have no clue what exactly. But believe me, you don't have to know it. The engineers of Dialog are so smart and I totally trust them".

So I'd very very very much would appreciate if I get docs & explaination for pros.

Thank you,

Thomas

PM_Dialog
Offline
Last seen:2 days 8 hours ago
Staff
加入:2018-02-08 11:03
Hi Thomas,

Hi Thomas,

Please refer toFigure 9: OTP layout with security features enabledin the DA14683 datasheet. According to that figure, the available space in the OTP to put the Secure secondary boot loader is58516 bytes, not 16K.

Could you please let us know where you found the limit of the 16K?

此外,缓存镜像或mode has nothing to do with the size where the code is saved. Please find some more details below:

-Mirrored mode:all the code is loaded in the RAM and executed entirely from there. In this case the whole code and data must fit in the 128K RAM (can be configured also to 144K = 128K RAM + 16K Cache RAM)

-XIP Cached mode:the code is executed in place (XIP) through cache mechanism. The cache mechanism uses 16K of RAM for the caching. The Data and RAM retained code must fit in the 128K. The total code can be up to 32MB in the FLASH where there can be enough space for such big code.

The 16K of cache does not mean that the code is loaded entirely there. It is a cache mechanism which loads part of the executable code as needed. It is a read only cache mechanism as well. In case of OTP, either cached or mirrored mode does not make any difference on the size of the code since the size of the OTP is smaller than the RAM.

In your case, the suggested approach would be to use the existing ble_suota_loader with the secure boot OTP configuration and add you extra functionality. If your extra functionality results to binary larger than the 58516 bytes available space in OTP, cached or mirror obviously will not help since the code does not fit in the OTP in the first place. In that case, a possible solution might be to split your secure boot to a more complex scheme where in the OTP will be the initial secure boot, which will load from the FLASH in a secure way their bigger custom secure boot. Then the custom secure boot from FLASH will have to do the actual FW loading in the secure way you want.

Thanks, PM_Dialog

weel1
Offline
Last seen:7 months 11 hours ago
加入:2020-06-20 08:35
Hello Dialog Support,

Hello Dialog Support,

I'm using is DA14683,Application firmware write external flash,Write the OTP of the DA14683 through the SmartSnippets Toolbox,Now I want to read BD address and chip ID in the OTP,What interfaces and functions do I need to use.

Thanks,
Perry

PM_Dialog
Offline
Last seen:2 days 8 hours ago
Staff
加入:2018-02-08 11:03
嗨weel1,

嗨weel1,

Thanks for posting online. In order to get the BD address from the OTP, please check out the instructions from a past forum thread - link is provided below :

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/how-get-bd-address-otp-rom

If you have any follow up question, I would recommend creating a new forum post as this one is old.

Thanks, PM_Dialog