Debugging secure boot flow

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BrVa_4679381
Level 1
Level 1
Welcome!

I'm running the PSoC 63 and I'm attempting to blow eFuse protections for my application to enable to full secure boot flow and it seems to NOT boot into my first app (classic). I'm running the same code before blowing the eFuse bits to ensure the signature verification flow works (from flashboot perspective) and everything seems fine. But after I run our script to blow eFuse it doesn't boot up. I set the protection as "Secure with debug" so if I attach to the M0+ core to attempt to gather clues, it looks like the PC is somewhere within the ROM code address space (I'm assuming). So I'm curious what debugging steps I have available to diagnose what the error is or if you could provide some guidance on what could possibly be going wrong? See screeshot of CPU registers.

Screen Shot 2020-09-17 at 11.44.15 AM.png

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi BrVa_4679381​,

The Table of Contents (which contains the start of application) Validation might be failing. Can you please let me know if you could try it out on a simple application first to ensure that the script works as expected? This way we can isolate the issue to the script or the project. Also, would it be possible to share your script?

You can try using the PPCLI commands and check if that is working.

Please let me know your observations.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
8 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi BrVa_4679381​,

The Table of Contents (which contains the start of application) Validation might be failing. Can you please let me know if you could try it out on a simple application first to ensure that the script works as expected? This way we can isolate the issue to the script or the project. Also, would it be possible to share your script?

You can try using the PPCLI commands and check if that is working.

Please let me know your observations.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

So I used the same application and programmed eFuse with PSoC Programmer and that worked, so it seems to be the script. Attached is what we're using. A question I had though, is it possible to use the Cypress Programmer utility to program eFuse too?

0 Likes

Hi BrVa_4679381​,

Yes. Please refer to Program eFuse Region of PSoC 6 MCU in page 33 of the Cypress Programmer User Guide.

Regards,

Rakshith

Thanks and Regards,
Rakshith M B
0 Likes

One other thing I noticed is that in the RAM location I use to determine a Flashboot error, there is a value that looks eerily similar to the Flashboot error code format. I get the value: 0xF0000010. Just curious could that be an error code from the ROM loader?

0 Likes

I think we found the source of error. We are using J-Link with that script to blow the eFuse. The ones that have failed before running the script and programming our code, we ran:
J-Link> exec EnableEraseAllFlashBanks

J-Link> erase

from the J-Link CLI. Could this have an effect on part of the SFlash that ROM uses in its secure hash check?

0 Likes

Hi BrVa_4679381,

I do not think erase all call is the reason for this issue. Even if it erases the SFlash, programming the hex should be updating the ToC and as you have mentioned that you are able to program the device and confirm that the application works as expected, it should be okay.

Are you performing an erase after programming the device and before burning eFuses?

Also can you please let us know the secure access restrictions used?

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

No, the steps we took are:

1.) Erase all flash (w/ exec EnableEraseAllFlashBanks)

2.) Program our code

3.) Burn eFuses

We are using secure with debug access restrictions

0 Likes

Hi BrVa_4679381,

The Secure Access Restrictions are as follows -

pastedImage_0.png

Also, can you please try reading the lifecycle stage or the protection state after programming the eFuses (before reset and after reset)? Can you please screenshot of the response?

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes