Skip to content

Initial addition of files to support CY8CKIT_064S2_4343W target #11434

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

Merged
merged 2 commits into from
Oct 18, 2019

Conversation

romanjoe
Copy link
Contributor

@romanjoe 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
Copy link
Contributor

0xc0170 commented Sep 6, 2019

For new targets, please attach testing logs

@ciarmcom ciarmcom requested review from maclobdell and a team September 6, 2019 15:00
@ciarmcom
Copy link
Member

ciarmcom commented Sep 6, 2019

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

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2019

@romanjoe Sharing the tests here? please attach them

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2019

I started CI meanwhile

@mbed-ci
Copy link

mbed-ci commented Sep 9, 2019

Test run: SUCCESS

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

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 11, 2019

@romanjoe Please provide test results

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 17, 2019

@romanjoe Please provide test results

Once done, this shall be ready for integration

@romanjoe romanjoe force-pushed the pr/cy8ckit_064s2_4343w branch from edea012 to b2c1855 Compare September 19, 2019 17:33
@romanjoe
Copy link
Contributor Author

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 pr/cy8ckit_064s2_4343w branch from b2c1855 to ee922a6 Compare September 20, 2019 11:19
@romanjoe
Copy link
Contributor Author

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 pr/cy8ckit_064s2_4343w branch 3 times, most recently from 8797956 to e939430 Compare September 24, 2019 18:45
@romanjoe
Copy link
Contributor Author

Tests run log added to header.

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

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 26, 2019

#11504

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

@romanjoe
Copy link
Contributor Author

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

Thank you.

Copy link
Contributor

@maclobdell maclobdell left a comment

Choose a reason for hiding this comment

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

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
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!

@maclobdell
Copy link
Contributor

@romanjoe - does this PR still depend on #11504. That one seems to be stuck. Either can you resolve #11504 quickly or can this PR be made to not depend on it?

@romanjoe
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 pr/cy8ckit_064s2_4343w branch from 4b42f58 to 9b86b39 Compare October 11, 2019 16:32
@romanjoe
Copy link
Contributor Author

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

@adbridge
Copy link
Contributor

CI started

@mbed-ci
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
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
Copy link
Contributor

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

@OPpuolitaival
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
Copy link
Contributor

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

@romanjoe
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
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Contributor

CI restarted

@mbed-ci
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 merged commit 9c82706 into ARMmbed:master Oct 18, 2019
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.

7 participants