ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.97k forks source link

update to psoc6pdl-1.6.1 broke `CYTFM_064B0S2_4343W` #13440

Closed moshe-shahar closed 4 years ago

moshe-shahar commented 4 years ago

Description of defect

After merging https://github.com/ARMmbed/mbed-os/pull/13386, CYTFM_064B0S2_4343W system init failed with hard fault

Target(s) affected by this defect ?

CYTFM_064B0S2_4343W

Toolchain(s) (name and version) displaying this defect ?

GCC_ARM

What version of Mbed-os are you using (tag or sha) ?

#327fe532b2dcec083fdc8abdc36a79070cad7d3a

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

How is this defect reproduced ?

  1. Clone https://github.com/ARMmbed/mbed-os-example-psa
  2. Apply the following to mbed_app.json
    diff --git a/mbed_app.json b/mbed_app.json
    index c8be573277..1903278312 100644
    --- a/mbed_app.json
    +++ b/mbed_app.json
    @@ -12,6 +12,11 @@
         },
         "CY8CKIT_064S2_4343W": {
             "rtos.thread-user-stack-size": 16384
    +        },
    +        "CYTFM_064B0S2_4343W": {
    +            "rtos.thread-user-stack-size"               : 16384,
    +            "platform.stdio-baud-rate"                  : 115200,
    +            "target.policy_file"                        :"policy_multi_CM0_CM4_jitp.json"
         }
     },
     "macros": [
  3. Build for CYTFM_064B0S2_4343W
0xc0170 commented 4 years ago

@ARMmbed/team-cypress Please review

0xc0170 commented 4 years ago

I would like to understand how this affects the planned release (code freeze 2 days ago). If this is a blocker, we need to have this fixed.

cc @andypowers @ARMmbed/mbed-os-maintainers

0xc0170 commented 4 years ago

@ARMmbed/team-cypress I would like to find out how many targets are affected - the scope of this issue. Are more targets affected?

The recent nightly do not contain greentea tests ( see http://mbed-os-ci.s3-website-eu-west-1.amazonaws.com/?prefix=jenkins-ci/ARMmbed/mbed-os/mbed-os-ci-nightly/artifacts/master/604/ ) - I already reported this to the test team.

ciarmcom commented 4 years ago

@moshe-shahar thank you for raising this issue.Please take a look at the following comments:

Could you add some more detail to the description? A good description should be at least 25 words. We cannot automatically identify a release based on the version of Mbed OS that you have provided. Please provide either a single valid sha of the form #abcde12 or #3b8265d70af32261311a06e423ca33434d8d80de or a single valid release tag of the form mbed-os-x.y.z . E.g. '327fe53' has not been matched as a valid tag or sha.It would help if you could also specify the versions of any tools you are using?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered. Please update the issue header with the missing information, the issue will not be mirroredto our internal defect tracking system or investigated until this has been fully resolved.

vmedcy commented 4 years ago

Hello, I guess the hard fault is expected as part of PRA driver design:

https://github.com/ARMmbed/mbed-os/blob/e95c64f/targets/TARGET_Cypress/TARGET_PSOC6/psoc6pdl/drivers/source/cy_pra.c#L150

psoc6pdl-1.6.0 provides PRA 1.0, psoc6pdl-1.6.1 - PRA 1.1. The version of PRA driver on CM0+ and Cm4 should be identical.

This information is available in PRA driver changelog: https://cypresssemiconductorco.github.io/psoc6pdl/pdl_api_reference_manual/html/group__group__pra.html

All PSoC 64 targets affected.

CC @avptin @romanjoe @ifyall

0xc0170 commented 4 years ago

@vmedcy Thanks for the details, regarding

psoc6pdl-1.6.0 provides PRA 1.0, psoc6pdl-1.6.1 - PRA 1.1. The version of PRA driver on CM0+ and Cm4 should be identical.

does that mean we got 2 different PRA or how shall I read it? How can this be fixed?

vmedcy commented 4 years ago

How can this be fixed?

Update CM0+ images to use PRA 2.0 as well. I don't know where these images are located and what is the update procedure. @romanjoe , @avptin - do you know what needs to happen to keep CM0+ part of PRA solution in sync?

romanjoe commented 4 years ago

@vmedcy cm0p image (tfm.hex) needs to be compiled with psoc6pdl-1.6.1, then this new cm0 image (tfm.hex one) will be compatible with corresponding psoc6pdl

moshe-shahar commented 4 years ago

AFAIK, @CharleyChu is working on a fix for CYTFM_064B0S2_4343W. I tested with his tfm_s.hex and it fixes this issue.

0xc0170 commented 4 years ago

AFAIK, @CharleyChu is working on a fix for CYTFM_064B0S2_4343W. I tested with his tfm_s.hex and it fixes this issue.

💯 great, will one target only be fixed ? I see in our tree 2 Cypress targets containing tfm_s.hex file

Note, we already created 6.2.1rc1 and this issue is present (as of master as well).

moshe-shahar commented 4 years ago

I don't know what is the status of CY8CKIT_064S2_4343W target.

0xc0170 commented 4 years ago

If this could be fixed today (a pull request created - we will run through the CI), we can generate rc2 otherwise if nothing else pops up, we would stay with rc1.

RaymondNgun commented 4 years ago

CY8CKIT_064S2_4343W should be deleted. The target was originally deleted but it looks like a couple patches crossed during merge and remnants of it is left behind.

0xc0170 commented 4 years ago

@CharleyChu @RaymondNgun shall we expect a patch today ? If not, we will proceed with rc1.

RaymondNgun commented 4 years ago

@0xc0170, yes... that is the plan for CYTFM_064B0S2_4343W. Thanks!