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

了解更多FAQsTutorials

6 posts / 0 new
Last post
托马斯·唐豪斯
Offline
Last seen:4 weeks 1 day ago
加入:2019-10-20 10:45
What is the right configuration for secure boot loader in OTP?

Hi PM_Dialog!

我需要开发一个特殊的OPT-secure引导加载程序,但不知道正确的配置是什么。在ble\u suota\u loader中,配置如下:
#define dg_configEXEC_MODE MODE_IS_MIRRORED
#define dg\u configCODE\u LOCATION NON\u VOLATILE\u IS无

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

设备:
PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
嗨,托马斯,

嗨,托马斯,

让我查一下,然后再给你回电。

In the meanwhile, have you checked the following tutorial?

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

谢谢,PM_Dialog

托马斯·唐豪斯
Offline
Last seen:4 weeks 1 day ago
加入:2019-10-20 10:45
你好,PM\U对话,

你好,PM\U对话,

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.

I learned this from 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.

我的客户是一家大公司,我不能告诉他们:“看,雷电竞下载app这是一个很酷的脚本,可以为你做任何事,但我不知道到底是什么。但相信我,你不必知道。Dialog的工程师非常聪明,我完全信任他们”。

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天19小时前
Staff
加入:2018-02-08 11:03
嗨,托马斯,

嗨,托马斯,

Please refer toFigure 9: OTP layout with security features enabled在DA14683数据表中。根据该图,OTP中用于放置安全辅助引导加载程序的可用空间是58516字节, 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缓存模式: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.

谢谢,PM_Dialog

weel1
Offline
Last seen:4 months 3 weeks ago
加入:2020-06-20 08:35
Hello Dialog Support,

Hello Dialog Support,

我用的是is DA14683,应用程序固件写外部flash,通过SmartSnippets工具箱写DA14683的OTP,现在我想读取OTP中的BD地址和芯片ID,我需要使用什么接口和函数。

谢谢,
Perry

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
Hi weel1,

Hi 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

如果你有任何后续问题,我建议创建一个新的论坛帖子,因为这是一个旧的。

谢谢,PM_Dialog