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

Initial addition of files to support CY8CKIT_064S2_4343W target #11434

Merged
merged 2 commits into from Oct 18, 2019

Conversation

@romanjoe
Copy link
Contributor

romanjoe commented Sep 6, 2019

Description

This PR brings support for new Cypress target in mbed-os - CY8CKIT_064S2_4343W.
PR includes all necessary files to integrate target with mbed-os build system and post build actions.

Tests run logs:

LIN_064S2_ARMC6_bg.txt
LIN_064S2_GCC_ARM_bg.txt
MAC_064S2_GCC_ARM_bg.txt
WIN_064S2_ARMC6_bg.txt
WIN_064S2_GCC_ARM_bg.txt
WIN_064S2_IAR_bg.txt

Pull request type

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

Reviewers

Release Notes

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 6, 2019

For new targets, please attach testing logs

@ciarmcom ciarmcom requested review from maclobdell and ARMmbed/mbed-os-maintainers Sep 6, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

ciarmcom commented Sep 6, 2019

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

@0xc0170
0xc0170 approved these changes Sep 9, 2019
@0xc0170 0xc0170 added needs: review and removed needs: review labels Sep 9, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 9, 2019

@romanjoe Sharing the tests here? please attach them

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 9, 2019

I started CI meanwhile

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Sep 9, 2019

Test run: SUCCESS

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

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 11, 2019

@romanjoe Please provide test results

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 17, 2019

@romanjoe Please provide test results

Once done, this shall be ready for integration

@romanjoe romanjoe force-pushed the romanjoe:pr/cy8ckit_064s2_4343w branch from edea012 to b2c1855 Sep 19, 2019
@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Sep 19, 2019

Hi @0xc0170, thank you for review.

I have updated PR regarding new changes in #11529 and made some fixes related to our internals.

I will attach test results tomorrow

@romanjoe romanjoe force-pushed the romanjoe:pr/cy8ckit_064s2_4343w branch from b2c1855 to ee922a6 Sep 20, 2019
@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Sep 20, 2019

This PR updated regarding related changes in #11516 and #11504. These 2 PRs add support for watchdog tests.

So currently this PR relies on
#11504
#11516
#11529

@romanjoe romanjoe force-pushed the romanjoe:pr/cy8ckit_064s2_4343w branch 3 times, most recently from 8797956 to e939430 Sep 24, 2019
@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Sep 25, 2019

Tests run log added to header.

@0xc0170 @maclobdell - could you please run CI and proceed with merging this PR.

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 26, 2019

#11504

We don't need this one, as stated above? If not, we can run CI!

@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Sep 26, 2019

@0xc0170 that one 11504 is not critical for this PR, so you can proceed with CI run.

Thank you.

Copy link
Contributor

maclobdell left a comment

Please confirm - is QSPIF possible on this board? is the supervisory flash area used in normal operation? If so, can the bootloader support that?

@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Oct 3, 2019

Hi @0xc0170,

@maclobdell has approved the code, could you please run the CI to finalize this PR?

Thank you!

@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Oct 11, 2019

@maclobdell Hi Mac, in current implementation this one depends on #11504, but since status and resolution of 11504 is not clear right now i can make a little tweak (it is ready, just need to push) to make this one work without 11504 to align implementation with existing CY8CKIT_062_WIFI_BT and we would be able to push this one forward.

In case 11504 would be merged - all existing targets would need update anyways.

@romanjoe romanjoe force-pushed the romanjoe:pr/cy8ckit_064s2_4343w branch from 4b42f58 to 9b86b39 Oct 11, 2019
@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Oct 11, 2019

@maclobdell i made required changes - now this PR in independent

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Oct 14, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 14, 2019

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR
@OPpuolitaival

This comment has been minimized.

Copy link
Contributor

OPpuolitaival commented Oct 14, 2019

[ERROR] PSOC6.sign_image finished execution with errors! Signature is not added
=> I will add signing key there

@OPpuolitaival

This comment has been minimized.

Copy link
Contributor

OPpuolitaival commented Oct 14, 2019

@jussisip could you check the CI scripts. I cannot find any problem in the logic.

@OPpuolitaival

This comment has been minimized.

Copy link
Contributor

OPpuolitaival commented Oct 14, 2019

@romanjoe This is pretty unclear case how it fails. This is handled similar way than CY8CPROTO_064_SB which works well. But in this happens:

  1. It compiles greentea tests well
  2. It compiles mbed-os-example-blinky normally but then
  3. mbed-os-example-wifi compile crashed with log:
[2019-10-14T10:03:31.103Z] Link: mbed-os-example-wifi
[2019-10-14T10:03:31.103Z] Elf2Bin: mbed-os-example-wifi
[2019-10-14T10:03:31.103Z] Post-Build: mbed-os-example-wifi
[2019-10-14T10:03:31.103Z] [PSOC6.sign_image] INFO: Image for slot UPGRADE would not be encrypted per policy settings
[2019-10-14T10:03:31.103Z] [ERROR] PSOC6.sign_image finished execution with errors! Signature is not added.

First line comes from

toolchain.notify.info("[PSOC6.sign_image] INFO: Image for slot UPGRADE would not be encrypted per policy settings")
but error may come from multiple choises. Cannot see which condition fails.

The key question is that what is so different in this than CY8CPROTO_064_SB that this cannot work? Wifi example build works well with CY8CPROTO_064_SB.

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Oct 14, 2019

@maclobdell can you chase this up please. This will now be bumped to 5.14.2

@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Oct 15, 2019

Hi @OPpuolitaival,

Problem with mbed-os-example-wifi raises because of lack of flash for this example. I suppose you would be able to find message similar to this:

[DEBUG] [PSOC6.sign_image] ERROR: Signature is not added!
[DEBUG] [PSOC6.sign_image] Message from imgtool: Traceback (most recent call last):
  File "/Users/rnok/repos/mbed-os-examples-official/mbed-os-example-wifi/mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/imgtool/imgtool.py", line 198, in <module>
    imgtool()
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/rnok/repos/mbed-os-examples-official/mbed-os-example-wifi/mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/imgtool/imgtool.py", line 156, in sign
    image_id=image_id, rollback_counter=rollback_counter)
  File "/Users/rnok/repos/mbed-os-examples-official/mbed-os-example-wifi/mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/imgtool/imgtool/image.py", line 88, in load
    obj.check()
  File "/Users/rnok/repos/mbed-os-examples-official/mbed-os-example-wifi/mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/imgtool/imgtool/image.py", line 133, in check
    raise Exception(msg)


----------------------------------------------------------------------------------------
Exception: Image size (0x942a8) + trailer (0x20) exceeds requested size 0x50000
----------------------------------------------------------------------------------------

This message comes from tool that adds cryptographic signature to compiled image. This tool has set of parameters used for adding signature. One of them is a slot size used by Cypressbootloader for boot. This value is set in policy file - mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/policy/policy_single_stage_CM4.json and equals 0x50000.

There should be 2 slots of this size to enable upgrade possibility using UPGRADE slot.

CY8CPROTO_064_SB target has no connectivity (thus no wifi/bt code compiled and included to hex file) and 1M of flash overall. So it can fit 2 slots of size 0x50000 (considering flash alignments restrictions and memory protection configuration restrictions).

CY8CKIT_064S2_4343W uses same policy file and slot sizes, but has wifi/bt and as result much bigger hex file, than 0x50000. Since this board has 2M of flash - slot sizes can be stretched to fit bigger hex file. This described in Secure Boot user guide and Readme.md in mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools (https://www.cypress.com/secureboot-sdk-user-guide).

As a solution for CI i can add additional file to mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/policy, with stretched bootloader slots sizes to use with CY8CKIT_064S2_4343W.

@OPpuolitaival

This comment has been minimized.

Copy link
Contributor

OPpuolitaival commented Oct 16, 2019

Probably we can limit

"github":"https://github.com/ARMmbed/mbed-os-example-wifi",
to wifi boards also but it does not fix this problem

@romanjoe

This comment has been minimized.

Copy link
Contributor Author

romanjoe commented Oct 16, 2019

@OPpuolitaival did you try to build wifi example with latest changes i made yesterday? i was able to compile and get image signed successfully with new policy file. actually having this new file as template for 2M board would provide better user experience with no need to read User Guide immediately after getting started

@OPpuolitaival

This comment has been minimized.

Copy link
Contributor

OPpuolitaival commented Oct 16, 2019

CI restarted

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 16, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added ready for merge and removed needs: work labels Oct 18, 2019
@0xc0170 0xc0170 merged commit 9c82706 into ARMmbed:master Oct 18, 2019
25 checks passed
25 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+1524 bytes) RAM(-8 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8680 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8464B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.