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:
.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 */
I removed CM7_1_ENABLE, but it doesn't work......
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?
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).
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.
Hi @OwO
Please help me clarify what you mean by "S32K blocked at our program"?
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
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.