The device cannot be booted after BOOT_SEQ_ENABLE is set and the device is restarted(S32K314)

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

The device cannot be booted after BOOT_SEQ_ENABLE is set and the device is restarted(S32K314)

1,419 Views
OwO
Contributor II

I have been using debug mode to adapt to the secure boot, and the secure boot has been working well, but after downloading through j-flash mode, I found that the device does not start normally,I found that it is caused by BOOT SEQ ENABLE in BCW.

The device cannot be booted after BOOT_SEQ_ENABLE is set and the device powercycle, But debugging with the S32DS can be started.

If I changed BCW(Boot configuration word) like this,it can be booted after device powercycle:

.long (CM7_0_ENABLE << CM7_0_ENABLE_SHIFT) | (CM7_1_ENABLE << CM7_1_ENABLE_SHIFT) | (BOOT_SEQ_ENABLE << BOOT_SEQ_SHIFT) /* Boot configuration word */

>>

.long (CM7_0_ENABLE << CM7_0_ENABLE_SHIFT) | (CM7_1_ENABLE << CM7_1_ENABLE_SHIFT) /* Boot configuration word */

 

The full startup cm7.s file is listed below:

#ifndef BOOT_SEQ_ENABLE
#define BOOT_SEQ_ENABLE (1)
#endif
 
#ifndef BOOT_SEQ_SHIFT
#define BOOT_SEQ_SHIFT (3)
#endif

.section ".boot_header","ax"
.long SBAF_BOOT_MARKER /* IVT marker */
#.long (CM7_0_ENABLE << CM7_0_ENABLE_SHIFT) | (CM7_1_ENABLE << CM7_1_ENABLE_SHIFT) /* Boot configuration word */
.long (CM7_0_ENABLE << CM7_0_ENABLE_SHIFT) | (CM7_1_ENABLE << CM7_1_ENABLE_SHIFT) | (BOOT_SEQ_ENABLE << BOOT_SEQ_SHIFT) /* Boot configuration word */
.long 0 /* Reserved */
.long CM7_0_VTOR_ADDR /* CM7_0 Start address */
.long 0 /* Reserved */
.long CM7_1_VTOR_ADDR /* CM7_1 Start address */
.long 0 /* Reserved */
.long 0 /* Reserved */
.long XRDC_CONFIG_ADDR /* XRDC configuration pointer */
.long LF_CONFIG_ADDR /* Lifecycle configuration pointer */
.long 0 /* Reserved */

0 Kudos
Reply
10 Replies

1,344 Views
OwO
Contributor II

I removed CM7_1_ENABLE, but it doesn't work......

0 Kudos
Reply

1,336 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @OwO 

Could you please explain more about what you say that the MCU "can't boot normally"? And what do you expect by enabling the secure boot? 

0 Kudos
Reply

1,319 Views
OwO
Contributor II
We set some CAN Message in program for check if S32K booted correctly. But when we tried to boot it, we can't get any CAN Message. Finally, we got the S32K hanged in NVM part.

We expect our S32K could send CAN Message successfully and run our true program.
0 Kudos
Reply

1,291 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @OwO 

Please, make sure to follow the procedure to configure the basic secure boot provided in the Secure Boot Application note v0.1.1.0 (AN744511). 

0 Kudos
Reply

1,280 Views
OwO
Contributor II
All right, I checked our procedure for secure boot, that's nothing different with Secure Boot Application note.

So, what should we try then? Change our flash toolchain? (e.g. J-Flash --> PEMicro CYCLONE FX)
0 Kudos
Reply

1,266 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @OwO 

Let's try to ensure that the Secure Boot works properly. We provide Secure Boot examples that you can use for this. These can be downloaded from S32K3 MCUs for General Purpose HSE Demo Examples.

0 Kudos
Reply

1,255 Views
OwO
Contributor II
I'm sure for it work properly, so we adapted this sample to our project as you see, but the S32K blocked at our program now...
0 Kudos
Reply

1,240 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @OwO 

Please help me clarify what you mean by "S32K blocked at our program"?

0 Kudos
Reply

1,392 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @OwO 

We understand that you are configuring secure boot (BOOT_SEQ equal to 1), but you are observing an unexpected behavior. Could you please explain more about the MCU's behavior? 

Also, an observation about the Boot configuration word you are defining, the S32K314 devices just have 1 core and you are manipulating BOOT_TARGET (CM7_1_ENABLE) where there is just core 0.

Additionally, 

We Have a Secure Boot application note that explains the functionality in detail.

It can be downloaded from:

S32K3 Microcontrollers for Automotive General Purpose

The application note can be found here:

Documentation -> Secure Files -> Secure Boot Application note v0.1.1.0 (AN744511)

The associated demo project can be downloaded here:

Design Resources -> Software -> Secure Files -> SecureBootAppNoteDemo (SW745310)

 

B.R.

VaneB

0 Kudos
Reply

1,382 Views
OwO
Contributor II

So, we need to remove ‘CM7_1_ENABLE’ configuration and have a try?

But it's odd that we could debug our device but can't boot normally.

We mocked some function to send CAN messages for checking whether our program start or not, but received nothing.

@wenfengyao Sorry for piss you up...but if have some tips for check why our S32K314 crush, plz share with us.

0 Kudos
Reply