Difficulty in understanding how to implement secure boot and bootloader

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Difficulty in understanding how to implement secure boot and bootloader

ソリューションへジャンプ
2,954件の閲覧回数
baseerahmadpiracha
Contributor III

I want to implement bootloader with secure boot to check bootloader for integrity and authenticity on S32K146. After reading AN4501.pdf I found that there are 5 steps in Programming the CSEc Security Module with 5 examples as well.

List of Examples:
1. Configure part and Load keys
2. Update user keys
3. Basic operations
4. Secure boot add BOOT MAC manual
5. Resetting flash to the factory state

So my question is for implementing above what steps I have to perform and how? My aim is to only implement bootloader and check bootloader for integrity and authenticity.

タグ(1)
0 件の賞賛
返信
1 解決策
2,900件の閲覧回数
baseerahmadpiracha
Contributor III

@lukaszadrapa @Keane I was able to resolve the issue by connecting the RESET pin of microcontroller with ground and when I clicked on connect Jlink showed that microcontroller is resetting. And after removing the reset pin from ground microcontroller started working fine. Thanks for the time

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
2,941件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @baseerahmadpiracha 

to enable the secure boot, it's necessary to enable the CSEc by executing Program Partition command and then it is necessary to load MASTER_ECU_KEY. These operations can be found in 1_Configure_part_and_Load_keys project.

Then you can skip directly to the 4_secure_boot_add_BOOT_MAC_manual which shows how to load BOOT_MAC_KEY, how to enable the secure boot and how to load BOOT_MAC (either automatically or manually). Notice that only manual option is possible in case of strict sequential secure boot mode.

 

If sequential or parallel boot mode fail, it does not affect the booting and application at all. The only effect is that boot protected keys cannot be used by the application. In this case BOK bit in FCSESTAT register will be '0' after boot.

The device will not start up only if strict sequential boot mode fails. In this case, the device will never leave reset and there’s no way to recover. The device must be replaced.

I recommend to thoroughly read AN5401 before your tests to avoid bricking of the device.

Regards,

Lukas

0 件の賞賛
返信
2,920件の閲覧回数
baseerahmadpiracha
Contributor III

Hi @lukaszadrapa 

I have tried to execute 1_Configure_part_and_Load_keys project on S32K144 and after programming when I tried to program again I am facing this error can you please guide what can be the possible reason?

 

baseerahmadpiracha_0-1677829940606.png

 

0 件の賞賛
返信
2,903件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

There's one problem with J-Link - when you load new project to the device by J-Link, it tries to perform mass erase. However, the mass erase is not allowed if CSEc is enabled. The CSEc needs to be disabled by CMD_DBG_CHAL and CMD_DBG_AUTH command (you need to know MASTER_ECU_KEY for this) and after that the mass erase is possible.

If Multilink or OpenSDA interface from Pemicro is used, then the flash is erased block by block, mass erase is not used, so it is possible to load new project to the flash even if CSEc is enabled.

As far as I know, Segger didn't change it until now. You can try to contact them if needed.

Regards,

Lukas

0 件の賞賛
返信
2,901件の閲覧回数
baseerahmadpiracha
Contributor III

@lukaszadrapa @Keane I was able to resolve the issue by connecting the RESET pin of microcontroller with ground and when I clicked on connect Jlink showed that microcontroller is resetting. And after removing the reset pin from ground microcontroller started working fine. Thanks for the time

0 件の賞賛
返信
2,914件の閲覧回数
Keane
Contributor I
It's probably because you erased FlexNVM(0x1000 0000~)
0 件の賞賛
返信