RT1015 BEE XIP Step Confirm

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1015 BEE XIP Step Confirm

4,704 Views
kensu
Contributor V

Hi,

I got doc from FAE, but I want to confirm some step.

Please check.

1. For pdf page 3 "Tools", I got image_enc.exe from FAE and rename to  ”image_enc.exe".

2. In page "Project modification", SDK Example: I use evkmimxrt1015_igpio_led_output SDK and generate evkmimxrt1015_igpio_led_output.s19 file with XIP_BOOT_HEADER_ENABLE=0 and XIP_BOOT_HEADER_DCD_ENABLE=0.

3. I prepare a folder and make all utility file in the same path and create a batch file.

4. In page 7 Generate secure image.

pastedImage_1.png

I change to 

elftosb.exe -f imx -V -c imx-flexspinor-normal-unsigned.bd -o ivt_igpio_led_output_srec.bin evkmimxrt1015_igpio_led_output.s19

5. pastedImage_2.png

My script is "image_enc.exe ifile=ivt_igpio_led_output_srec.bin ofile=ivt_igpio_led_output_srec_encrypt.bin base_addr=0x60000000 region0_key=00112233445566778899aabbccddeeff region0_arg=1,[0x60001000,0x2000,0]"

6.pastedImage_3.png

I made a tool to remove first 1KB data.

My script is "RemoveBinaryBytes.exe ivt_igpio_led_output_srec_encrypt.bin ivt_igpio_led_output_srec_encrypt_remove1K.bin 1024"

My output is ivt_igpio_led_output_srec_encrypt_remove1K.bin.

7. 

pastedImage_4.png

My script is "elftosb.exe -f kinetis -V -c program_flexspinor_image_hyperflash_encrypt_sw_gp2.bd -o boot_image_encrypt.sb ivt_igpio_led_output_srec_encrypt_remove1K.bin"

 

The final sb file is "boot_image_encrypt.sb".

I attach all of my script and bin file.

8. pastedImage_5.png

pastedImage_6.png

I think the boot_image.sb is the boot_image_encrypt.sb file.

But in this step, I am confused.

From AN12079, I guess it should modify the ucl2.xml file, but my doc doesn't mentioned about it.

Here is the page 29 of AN12079.

pastedImage_7.png

Sorry I change to simplified Chinese here.

疑问一:

我的program_flexspinor_image_hyperflash_encrypt_sw_gp2.bd档案当中

section(0)里面的动作,是不是都要透过blhost去执行,我必须跟AN12079一样,加上blhost receive-sb-file的command

FAE给我的doc中,只提到将Flashloader的ini里面的name改成 name = MXRT105X-DevBoot

我认为这边是有问题的

疑问二:

program_flexspinor_image_hyperflash_encrypt_sw_gp2.bd档案当中

sources {
myBinFile = extern (0);
}

以及

#5. Program image
load myBinFile > kAbsAddr_Ivt;

我看不懂是将哪一个档案load到kAbsAddr_Ivt这一个位置?

Assign to Kerry

To Kerry: 你可以使用英文或中文回覆

附件有我的SDK和我的script以及FAE提供的doc

Regards

Ken

Labels (1)
Tags (1)
0 Kudos
35 Replies

3,428 Views
kerryzhou
NXP TechSupport
NXP TechSupport

楼主你好!

感谢你新建case的合作,已经收到最新回复你关于usb工程重设SP的方法解决了你的问题。

另外,昨天和我们的AE讨论了你的问题并证实给你的方案能解决问题之后,我们热心的AE也写了一篇更深入的文章来讲之前代码跑飞的原因,如果有时间,欢迎查看我们AE的文章:

https://www.cnblogs.com/henjay724/p/13652875.html

一定能让你收获颇丰。

如果还有任何新的问题,欢迎新建case或者新建问题贴!

 

0 Kudos

3,443 Views
kerryzhou
NXP TechSupport
NXP TechSupport

楼主你好!

我记得你这个帖子后面好像有个测试某个app有问题的情况,现在论坛改变了,我很难直接找到你后续的问题。

所以,你那边是否可以重新建一个case,可以说分配给kerryzhou,这样我可以在新的帖子里面回复你。

现在新的论坛,不太好在很长的帖子里面找你当时的问题,感谢你的理解。

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

0 Kudos

3,462 Views
kensu
Contributor V

Hi Kerry 

 

不确定你有没有看到我的回覆,如果你有什么建议,请再回覆我

 

 

 

kensu_0-1599179553249.png

謝謝

Ken

0 Kudos

3,529 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

  你那边是否有所更新,是否能照着我的步骤完成命令烧写BEE 并成功Boot?

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,529 Views
kensu
Contributor V

Hi Kerry

这边想先跟你确认

RT1015 APP BEE encryption operation method 

pastedImage_1.png

这边提到app file preparation,我发现你没有提到要手动更改Flash位址设定

因為我拿到的SOP提到

"Modify the memory configuration start from 0x60002000"

pastedImage_3.png

这个部分其实是不需要的吗?

Regards

Ken

0 Kudos

3,529 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

   如果你查看我的evkmimxrt1015_iled_blinky_0x60002000.s19文件,你会发现我的文件直接就是从0X2000开始的。

pastedImage_1.png

其实你不需要手动改,你看我这边是从0x60000000放firmware:

pastedImage_3.png

但是,你注意,你看我XIP_BOOT_HEARDER_ENABLE是不是配置为0了?

pastedImage_4.png

XIP_BOOT_HEARDER_ENABLE=0,意味着,我生成的.s19文件不带头,不带哪些头呢? 

1. 从0x60000000开始放的CFG代码

pastedImage_6.png

2. 从0X60001000开始的IVT代码

pastedImage_7.png

这些代码,我都交由commander line,或者MCUBootUtility去添加了。

所以你看我就算不改地址,我的app照样是从0X60002000开始存放。

如果你完全按照我的步骤走,你不需要修改你的memory 起始地址。

 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,529 Views
kensu
Contributor V

Hi Kerry

谢谢解释

我懂了

关键是XIP_BOOT_HEARDER_ENABLE=0

我目前一样使用NXP的RT1015 EVK,这片板子之前做过很多次MCUBootUtility的测试,

如果我使用All-In-One-Action 程式似乎就当掉了,不会动作,只能强制关闭

pastedImage_1.png

因此我才会透过"Image Loading Sequence"的Load Encrypted Image

但是我每次操作都会出现以下的错误讯息

pastedImage_2.png

因此我直接使用Blhost tool将"ivt_evkmimxrt1015_igpio_led_output_unsigned_bee_encrypted_nocfgblock.bin"这个档案,直接烧到0x60000400的位置 --> 这样是可以的吗?

即使这样,EVK SW8 设定为 1-ON,2-OFF,3-ON,4-OFF重开机后,EVK依然进入Download mode

这边我想确认一下,BEE XIP会需要用到0x680 (SW_GP1[31:0])吗?

因为我发现MCUBootUtility会把它也锁住

附上我的eFuse

pastedImage_3.png

我会再继续确认

Regards

Ken

0 Kudos

3,538 Views
kensu
Contributor V

Hi Kerry

上午好

我将你8/17放上去的附件

pastedImage_1.png

产生出来的boot_image_encrypt.sb档案,透过MFGTool(我使用1020的)下载到板子上

下载的方式就是使用MXRT102x-DevBoot 的ini设定

pastedImage_2.png

LED开始闪烁,因此我认为是Image成功运作

接下来我确认有哪些差异时,我发现我自己编译出来的s19不太一样

后来我发现我的专案用的是evkmimxrt1015_igpio_led_output

再次确认后,我改用一样的专案evkmimxrt1015_iled_blinky ,

我产生出来的s19档案依然和你的不一样,但我烧进去是可以运作的,

我修改source把LED闪烁的频率加快,确认也没有问题

我s19檔案產生的方式是使用

pastedImage_4.png

我想这应该是没问题的

毕竟我可以烧进去我自己修改过的evkmimxrt1015_iled_blinky


现在我想唯一的差异是

evkmimxrt1015_igpio_led_output编译出来的s19档案比较大了一点

pastedImage_3.png

使用evkmimxrt1015_igpio_led_output

MFGTool烧录就会出现错误

我想是Size不同 应该要修改一些设定

Regards

Ken

0 Kudos

3,538 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

   那么总之,你现在那边也能用你自己的代码烧进去工作了,只是有个别的代码不能运行,比如evkmimxrt1015_igpio_led_output直接生成你那边不行,对吧?

  我还有个办法,就是修改imx-flexspinor-unsigned.bd

options {
flags = 0x00;
startAddress = 0x60000000;
ivtOffset = 0x1000;
initialLoadSize = 0x2000;
//DCDFilePath = "dcd.bin";
# Note: This is required if the default entrypoint is not the Reset_Handler
# Please set the entryPointAddress to Reset_Handler address
// entryPointAddress = 0x60002000;
}

这里,entryPointAddress, 你把它直接写成你image reset的入口地址,你看下你的app.s19。

比如我的.s19,可以写成

entryPointAddress = 0x600021A9;

pastedImage_1.png

你这样试试去生成IVT,然后再跑看看是不是就行了。

  

 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,538 Views
kensu
Contributor V

Hi Kerry

我update目前的状态

目前我一共试了以下的SDK范例

pastedImage_1.png

除了evkmimxrt1015_dev_cdc_vcom_freertos.s19之外,其余的都可以跑

原先evkmimxrt1015_igpio_led_output.s19无法跑,而且是MFGTool就出错,因此我认为可能Erase空间不足,

我把Erase加大后,就可以跑了,其余的专案也都可以

pastedImage_2.png

唯独evkmimxrt1015_dev_cdc_vcom_freertos.s19依然无法
现象是MFGTool烧录成功,但是Image没有跑起来

我有试过entryPointAddress = 0x600022A9; //

结果是无效的

这边有什么建议吗?

Regards

Ken

0 Kudos

3,538 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su

   这个例程:

evkmimxrt1015_dev_cdc_vcom_freertos.s19

如果你不用加密模式是否能跑?

还有0X60002000偏移入口是否试过?

这个代码应该是比较大的,查看下代码大小,擦除尺寸包含整个image空间。

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,538 Views
kensu
Contributor V

Hi Kerry

我确认过无加密的状态下

evkmimxrt1015_dev_cdc_vcom_freertos 是可以成功执行的

Erase部分目前我是加到1MB,应该已经足够了

pastedImage_2.png

还有0X60002000偏移入口是否试过?

-->你指的是 加上entryPointAddress = 0x600022A9; 吗 (這邊有試過了)

Regards

Ken

0 Kudos

3,538 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

   evkmimxrt1015_dev_cdc_vcom_freertos 无加密可以,BEE加密就不行,是这个意思吗?

   用MCUBootUtiltiy烧录也不行?

   入口地址entryPointAddress=0x60000000, 还有ResetHandler都试了也是一样情况,对吗?

   如果确实是这样,你先测试其他可以工作的,这个等我有空帮你测试下。这几天可能没有时间测试,明后天我休假,今天还有很多case需要测试,所以你先做其他可以用的,这个问题等我抽出空,帮你测试下看看具体i情况。

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,538 Views
kensu
Contributor V

Hi Kerry

是的

非常谢谢你的帮忙,等你有空再帮我确认

因为我的案子 就是根据evkmimxrt1015_dev_cdc_vcom_freertos做为base开发的

  evkmimxrt1015_dev_cdc_vcom_freertos 无加密可以,BEE加密就不行,是这个意思吗?

-->是的 目前是这样

我會再繼續試

Regards

Ken

0 Kudos

3,538 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

   那么你有没有用MCUBootUtilitytool 去在BEE模式下下载这个evkmimxrt1015_dev_cdc_vcom_freertos代码,是否也是不能工作?不过话说回来,如果不加密可以,加密不行,可能还是和BEE的模块哪些限制有关了,具体我还需要时间去深入查看。

   不管怎样,你那边测试有任何更新,都请告诉我!

    你那边app可以先在非加密模式下去开发,等我后面慢慢去看这个到底和BEE哪些限制有关了。

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,538 Views
kensu
Contributor V

Hi Kerry

MCUBootUtilitytool 

我一直都有会当掉的问题,下图是使用All-In-One-Action

pastedImage_1.png

这边有机会跟Jay确认吗?

Regards

Ken

0 Kudos

3,538 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

  你这个问题,我建议你把MCUBootUtility放到比较浅的路径下面,有可能是软件放的路径比较深的原因。

  比如你放到桌面路径试试,看看是否能解决这个问题?

  如果还有问题,还请告诉我。

Best Regards,

Kerry

0 Kudos

3,537 Views
kensu
Contributor V

Hi Kerry

早安

后来我将MCUBootUtility移到另一台电脑就可以正常执行,但后来还是无法跑evkmimxrt1015_dev_cdc_vcom_freertos这一个SDK范例


昨天我同事发了一个地方,设定XIP_BOOT_HEADER_ENABLE=0,他直接在MCUXpresso上面开始单步执行,发现程式跑到某一行后就当掉了

 

Task.jpg

于是先将这一行注解掉,程式就可以正常跑

接下来我一样用Script加密的方式,将注解掉这行CODE的Image,测试BEE XIP

我发现他也能执行了!

 

因此XIP_BOOT_HEADER_ENABLE=0

从实验来看,他影响了程式的执行

PS: evkmimxrt1015_dev_cdc_vcom_freertos这个范例我有确认过XIP_BOOT_HEADER_ENABLE=1的设定下是可以跑未加密的模式

你这边有什么看法吗? 这会是Bug吗?

 

Regards

Ken

 

 

 

 

0 Kudos

3,534 Views
kensu
Contributor V

Hi Kerry

还有一点想要确认

我将我的EVK设定为SW8 设定为 1-"OFF",2-OFF,3-ON,4-OFF,烧录没有加密的Image,
Image可以正常执行,我这样做是为了确认我的板子跟IC还是正常运作的。

接下来

我做了一个实验SW8 设定为 1-"ON",2-OFF,3-ON,4-OFF,一样烧录没有加密的Image,

Image还是可以正常执行,这是合理的吗?

Regards

Ken

0 Kudos

3,538 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su

   我认为,如果芯片读取前面的 EKIB, EPRDB区域,没有有效数据,然后就认为你是没有加密,并且按照无加密image去执行了,所以这个应该不算有问题。

   你现在是使用我的image可以,你自己的image就不行,对吗?

Best Regards,

Kerry

0 Kudos