Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSOC6: initial integration of Cypress HAL #10692

Merged
merged 22 commits into from
Jul 11, 2019
Merged

PSOC6: initial integration of Cypress HAL #10692

merged 22 commits into from
Jul 11, 2019

Conversation

vmedcy
Copy link
Contributor

@vmedcy vmedcy commented May 28, 2019

Description

This PR brings the following major updates to the Cypress PSoC 6 targets for Mbed OS 5.13:

  • Initial implementation of the Cypress PSoC 6 hardware abstraction layer (targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/hal)
  • Ported Mbed OS HAL APIs implementation on top of the Cypress HAL (targets/TARGET_Cypress/TARGET_PSOC6/cy_*_api.c)
  • Initial implementation of the Cypress Wi-Fi Host Driver (targets/TARGET_Cypress/TARGET_PSOC6/TARGET_WHD)
  • WHD implementation of EMAC driver and NetworkInterfaceAPI (features/netsocket/emac-drivers/TARGET_Cypress/TARGET_PSOC6/TARGET_WHD)
  • USB device HAL implementation
  • Simplification of the CM0+ prebuilt application merging flow (replaced Python post-binary hex_filename merging hooks with prebuilt C arrays managed by the standard toolchain linker script).

Pull request type

[ ] Fix
[ ] Refactor
[X] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@ARMmbed/team-cypress

Release Notes

@ciarmcom ciarmcom requested review from a team May 28, 2019 19:00
@ciarmcom
Copy link
Member

@vmedcy, thank you for your changes.
@ARMmbed/mbed-os-maintainers @ARMmbed/mbed-os-ipcore please review.

@maclobdell
Copy link
Contributor

I just pulled this and tried to build the PSA target version with the following command (using Arm Compiler 6)

mbed compile -m CY8CKIT_062_WIFI_BT_PSA -t ARM

I get the following error.

Compile [ 85.9%]: spm_init_api.c
[Fatal Error] spm_init_api.c@27,10: 'psoc6_utils.h' file not found
[ERROR] .\mbed-os\targets\TARGET_Cypress\TARGET_PSOC6\TARGET_CY8CKIT_062_WIFI_BT_PSA\spm_init_api.c:27:10: fatal error: 'psoc6_utils.h' file not found
#include "psoc6_utils.h"

It looks like that file was previously located at C:\Users\maclob01\Documents\mbed-os-5\pe\mbed-os\targets\TARGET_Cypress\TARGET_PSOC6\psoc6_utils.h, but now it is not present anywhere. I'm not sure if it is actually needed or not.

#ifndef LWIP_RAW
#define LWIP_RAW 0
#endif
#define LWIP_RAW 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were added for PSOC6 testing but it is not clear if they should remain here as they affect all targets.
@vmedcy @morser499

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not, this PR can be dependent on it (will be treated like that if required). I already mentioned few other issues like this, please create separate PR. They will get much faster in and easier to review.

Copy link
Contributor Author

@vmedcy vmedcy Jul 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LWIP_RAW change moved to #10978

@hennadiykytsun
Copy link
Contributor

Issue #10515 is not applicable anymore. It was fixed in mbed-os 5.13.0 per the PR#10747 according to the following issues: #10613 and #10731 that were introduced by PR#10078.

@maclobdell
Copy link
Contributor

@hennadiykytsun - perhaps this PR needs to be rebased to the latest master then, to avoid possibility that PR 10747 gets reverted? I will let the maintainers determine if that is necessary.

@hennadiykytsun
Copy link
Contributor

hennadiykytsun commented Jul 2, 2019

@maclobdell - I have verified each Cypress target in this pull request - each of them has fix from the latest master. All asm files are correct.

@cypress-neil
Copy link
Contributor

This should be the complete set of changes for the release.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 4, 2019

Are all commits ready for release (no need to clean - squash/rebase) ? I can see some merge commits in the history, they cause issues in patch releases. Is this targeting the next minor release?

@vmedcy
Copy link
Contributor Author

vmedcy commented Jul 4, 2019

@0xc0170: yes, this PR is ready for release, targeting 5.13.1.

Can you clarify your request to remove merge commits: is rebase required?

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 4, 2019

Can you clarify your request to remove merge commits: is rebase required?

If this is targeting the patch release (the next one will be 5.13.2), then yes. Cherry-pick will be difficult with merge commits

@vmedcy
Copy link
Contributor Author

vmedcy commented Jul 4, 2019

Rebased against latest ARMmbed/master (this removed merge commits)

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 4, 2019

I triggered CI run, will review tomorrow

@mbed-ci
Copy link

mbed-ci commented Jul 11, 2019

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@vmedcy
Copy link
Contributor Author

vmedcy commented Jul 11, 2019

I reviewed the fail log: mbed-os-greentea_FUTURE_SEQUANA_ARM.log.

The error is related to FUTURE_SEQUANA targets inheriting TARGET_PSOC6 but not implementing DEVICE_I2CSLAVE and DEVICE_SPISLAVE. Fixing targets.json to add device_has_remove appropriately.

@vmedcy
Copy link
Contributor Author

vmedcy commented Jul 11, 2019

Removed DEVICE_I2CSLAVE for FUTURE_SEQUANA targets in b652407.
DEVICE_SPISLAVE is actually implemented in targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/spi_api.c, no change needed.
Checked FUTURE_SEQUANA and FUTURE_SEQUANA_PSA targets compile successfully.

@adbridge
Copy link
Contributor

ci restarted

Copy link

@AnttiKauppila AnttiKauppila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through the code and left couple of questions. Those won't be blocking this PR.

@mbed-ci
Copy link

mbed-ci commented Jul 11, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 5
Build artifacts

@evedon evedon merged commit 22c82dc into ARMmbed:master Jul 11, 2019
@evedon evedon removed the needs: CI label Jul 11, 2019
@adbridge
Copy link
Contributor

adbridge commented Jul 11, 2019

@vmedcy We are having problems patching this across to the 5.13 release branch, getting these errors:
error: Failed to merge in the changes.
Patch failed at 0014 PSOC6: remove PSA targets
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.

Are we sure there are no dependencies on any other PR on master that this is sitting on top of ?

@adbridge
Copy link
Contributor

@adbridge It looks like your comment dropped the actual errors.

There now

@adbridge
Copy link
Contributor

I've tried applying as a full patch and by cherry picking individual commits , both ways get stuck at that same commit

@ifyall
Copy link

ifyall commented Jul 11, 2019

@adbridge Thank you. I have asked someone in our US offices to look at this, as the day has ended for @vmedcy.

@cypress-neil
Copy link
Contributor

The changes from this pull request conflict with 39f0997 and 6084069 which exist on mbed-os-5.13.1 but not master. I was able to merge the commits using cherry-pick and manual conflict resolution.

@ifyall
Copy link

ifyall commented Jul 11, 2019

@adbridge How should @cypress-neil show his work on the cherry-picking and manual resolution? A new PR?

@adbridge
Copy link
Contributor

I suggest making an equivalent PR to the mbed-os-5.13 branch for these changes. That may well then need rebasing once we drop the rest of the patch release there

@morser499
Copy link

To address the conflict with 'remove PSA targets' the PSA targets should be removed from the targets.json file and the 5 .hex files should be deleted.

@adbridge
Copy link
Contributor

@morser499 can you guys please create a new PR directly against the mbed-os-5.13 branch, perhaps combining this PR with 11027 so we can bring both across easily ? NOTE we wouldn't normally do it this way but I think it will be the quickest way to try and ensure both get into the patch release.

@ifyall
Copy link

ifyall commented Jul 11, 2019

@adbridge Ryan and his team will be working on the new PR starting in about 30 minutes or so.

@cypress-neil
Copy link
Contributor

Created #11030

@ifyall
Copy link

ifyall commented Jul 11, 2019

@adbridge Neil has created the requested PR and linked it above. Thanks.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 12, 2019

I came across this PR today while searching for answer why some PSA targets were removed - in this PR. There is a commit "PSOC6: remove PSA targets" - does not explain why it is being removed. Please in the future, add more content to the commit message. I don't understand how "initial integration of Cypress HAL" is related to removing targets.

Removing targets is not considered only "a target update" but rather functionality change - whoever used this target won't be able to use it after the release 5.13.1. We need to be more careful with changes like this and do not mix multiple PR types to avoid the surprises like this one.

@JanneKiiskila
Copy link
Contributor

This breaks our CI now, as we are using CY8CKIT_062_WIFI_BT_PSA as one of our targets. I am not really sure was this intended?
@maclobdell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.