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

PSoC™ 6 SDK Forum Discussions

NovoNate
Level 2
First solution authored 10 sign-ins First like received
Level 2

Hello,

We are developing a product that contains the CY8C6347 part using ModusToolbox v2.3.1 and we are running into issues when trying to create a boot loader that uses the "secure image" functionality as outlined in AN221111.

To start with we made a simple "bootloader" application that runs on the CM0+ core and launches our main application that runs on the CM4 core. For this the "Dual CPU IPC Pipes" (https://github.com/Infineon/mtb-example-psoc6-dual-cpu-ipc-pipes) example was used.

That version of our "bootloader" is operating correctly, however when we start to pull in the "secure image" functionality that are described in AN221111 (and in the examples from the PSoC Creator PDL distribution) we are encountering an error when building the CM4 application. The behavior that we are seeing is that after the CM0 project is compiled the build process appears to stall/hang for a minute or two. While this is happening the windows task manager shows perl process that is consuming a fair amount of CPU as well as 3+ GB of RAM. That process appears to succeed, but then when gcc tries to compile the `.c` file that the perl script generates it errors out due to running out of memory.

I'm guessing that what is going on is that since the "secure image" process requires use of the `TOC2` instances that reside in SFLASH which is at address 0x16007C00 is causing the .bin and .c files to be very large and that is what is causing the perl script to take so long to complete and what causes the compile to error out. The .bin file is 98,336KB and the .c file is 329,231KB. That size for the .bin file seems to correspond with the offset of the SFLASH TOC2 instances within the flash area.

Has this issue been encountered before? Are there any solutions/workarounds?

0 Likes
1 Solution
NovoNate
Level 2
First solution authored 10 sign-ins First like received
Level 2

Hi Dheeraj,

 

I was able to get a functional "secure boot loader" that is getting validated by the FLASHBOOT code before loading.

Since this application is tight on flash space we are not planning on using MCUBOOT so I used the older PSoC Creator based example code as a basis for validating the user application image. We still haven't implemented the protection context or eFuse functionality yet. If we run into questions on that we will ask that in a separate question.

View solution in original post

0 Likes
3 Replies
DheerajK_81
Moderator
Moderator First comment on KBA First comment on blog 5 questions asked
Moderator

Hello @NovoNate ,

We have released a new security code example specifically for ModusToolbox. You can find it here: https://github.com/Infineon/mtb-example-psoc6-security

Also, it seems like you may be using the older version of the AN221111 App Note. Please find the latest Rev*C version here

There maybe various issues with copying code from PSoC Creator based example. I recommend modifying your application based on the code example developed in ModusToolbox. Do let us know if you face any issues while doing so. The code example has been developed on ModusToolbox v2.4. 

Regards,
Dheeraj

0 Likes
NovoNate
Level 2
First solution authored 10 sign-ins First like received
Level 2

Dheeraj,

 

Thanks for the quick response. It looks like that example was just posted last week which explains why I didn't find it when i was looking through the examples a couple of weeks ago.

I will look over that example and the updated app note and follow up with any further questions.

NovoNate
Level 2
First solution authored 10 sign-ins First like received
Level 2

Hi Dheeraj,

 

I was able to get a functional "secure boot loader" that is getting validated by the FLASHBOOT code before loading.

Since this application is tight on flash space we are not planning on using MCUBOOT so I used the older PSoC Creator based example code as a basis for validating the user application image. We still haven't implemented the protection context or eFuse functionality yet. If we run into questions on that we will ask that in a separate question.

0 Likes