CY8CKIT-064S0S2-4343W init_cycfg_system error

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

cross mob
lock attach
Attachments are accessible only for community members.
hastings
Level 1
Level 1
5 sign-ins First reply posted First question asked

I have created a sample project for the  CY8CKIT-064S0S2-4343W based on the Empty PSoC6 App template. When running the code, the call to set the system configuration (below) returns a configStatus of CY_PRA_STATUS_ERROR_PROCESSING_CLKLF.

configStatus = CY_PRA_FUNCTION_CALL_RETURN_PARAM(CY_PRA_MSG_TYPE_SYS_CFG_FUNC,
CY_PRA_FUNC_INIT_CYCFG_DEVICE,
&srss_0_clock_0_secureConfig);
if ( configStatus != CY_PRA_STATUS_SUCCESS )
{
cycfg_ClockStartupError(configStatus);
}

Here is the clock configuration:

design_modus.png

This does not happen when running the aws_demos so I am sure it is something in my configuration but I can't seem to figure out what I am doing wrong.  The return status to code only appears in Cy_PRA_ClkLfInit() in cy_pra_cfg.c but I never see this function get called by the M4.

Any ideas??

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

Hi @hastings

The CY8CKIT-064S0S2-4343W BSP is released and can be imported directly using the Project Creator tool and you do not have to create a custom BSP now.

We were able to recreate the issue that you mentioned. The WDT is enabled by default for the CM0+ application in the policy_multi_CM0_CM4_tfm.json policy file. Can you please set "wdt_enable" to false and let me know if this works for you?

The policy is located in this directory - mtb_shared/trusted-firmware-m/release-v1.3.1/security/policy/policy_multi_CM0_CM4_tfm.json

I will create an internal ticket to change the default policy. Thank you very much for pointing this out!

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
8 Replies
hastings
Level 1
Level 1
5 sign-ins First reply posted First question asked

Note: I followed the steps in Creating Custom BSPs in ModusToolbox - KBA230822 to create the sample project.

https://community.infineon.com/t5/Knowledge-Base-Articles/Creating-Custom-BSPs-in-ModusToolbox-KBA23...

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

Hi @hastings

The CY8CKIT-064S0S2-4343W BSP is released and can be imported directly using the Project Creator tool and you do not have to create a custom BSP now.

We were able to recreate the issue that you mentioned. The WDT is enabled by default for the CM0+ application in the policy_multi_CM0_CM4_tfm.json policy file. Can you please set "wdt_enable" to false and let me know if this works for you?

The policy is located in this directory - mtb_shared/trusted-firmware-m/release-v1.3.1/security/policy/policy_multi_CM0_CM4_tfm.json

I will create an internal ticket to change the default policy. Thank you very much for pointing this out!

Thanks and Regards,
Rakshith M B
0 Likes

Rakshith,

Thank you for the feedback. I made the change you suggeted to the policy file and re-provisioned the device. The configStatus value returned was CY_PRA_STATUS_ERROR_PROCESSING_ILO.

Your comments about the WDT made me look closer at the initialization code. I add the lines in to unlock and disable the WDT in my main function. The call to init_cycfg_system() is now successful. The result of the secure clock configuration is now CY_PRA_STATUS_SUCCESS.

int main(void)
{
    cy_rslt_t result;

    /* Unlock and disable the WDT */
    Cy_WDT_Unlock();
    Cy_WDT_Disable();

    /* Initialize the device and board peripherals */
    result = cybsp_init() ;
    if (result != CY_RSLT_SUCCESS)
    {
        CY_ASSERT(0);
    }

    __enable_irq();

    for (;;)
    {
    }
    return 0;
}

 

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

Hi @hastings

Glad that you were able to get it to work now. Thank you very much for sharing it on the community. But I would like to investigate further on this issue to fix it in further revisions. The suggested change should be able to disable the WDT and it worked for us.

Can you please share the policy file so that we can compare it with our policy that is currently working?

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.
hastings
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi Rakshith,

Here is the policy file I used. Per your prior suggestion, I had changed line 68 to  "wdt_enable": false .

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

Hi @hastings

Thank you for sharing the policy file. Line 68 is for the image with id=0 which in this case would be the CySecureBootloader. Can you please try changing line 115 and let me know if that works? Line 115 is for the image with id=1 which in this case is the CM0+ application. Please let me know your observations.

Thanks and Regards,
Rakshith M B
0 Likes

Rakshith,

I hadn't notices that there were multiple app ids. Secure clock configuration is successful with wdt_enable: false for id=1.

Thanks for the help 😀 

 

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

Glad you were able to resolve the issue. We will fix this in the next release. Thanks a lot for pointing this out!

Thanks and Regards,
Rakshith M B
0 Likes