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
托马斯唐豪瑟
Offline
Last seen:3个月2周前
加入:2019-10-20 10:45
What is the right configuration for secure boot loader in OTP?

Hi PM_Dialog!

我需要开发一个Spezial Opt Secure Bootloader,不知道正确的配置是什么。在BLE_SUOTA_LOADER中,配置如下:
#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

设备:
PM_Dialog
Offline
Last seen:1天12小时前
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:3个月2周前
加入:2019-10-20 10:45
你好pm_dialog,

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

我从调试中学到了这一点。但我更愿意有一个解释它的文件。因此,在时间后,我会感到沮丧阅读文档,显示脚本脚本以执行。这绝对不是开发人员需要的。对于那些想要在他们的爱好地下室游戏但是专业人士完全不足的人来说,这对那些人来说很好。

我的客户是一个庞大的公司,我不能告诉他们:“雷电竞下载app看看这是一个对你有所作为的很酷的脚本,但我没有任何线索究竟是什么。但相信我,你不必知道它。工程师对话是如此聪明,我完全相信它们“。

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

Thank you,

Thomas

PM_Dialog
Offline
Last seen:1天12小时前
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:7个月1周前
加入:2020-06-20 08:35
您好对话框支持,

您好对话框支持,

我正在使用的是DA14683,应用程序固件写入外部闪光,通过SmartSnippets Toolbox写下DA14683的OTP,现在我想在OTP中读取BD地址和芯片ID,我需要使用什么界面和函数。

谢谢,
Perry

PM_Dialog
Offline
Last seen:1天12小时前
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