Skip to content

Add ARM_MUSCA_S1 as a new target platform #13196

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
Sep 10, 2020

Conversation

gbrtth
Copy link
Contributor

@gbrtth gbrtth commented Jun 26, 2020

Summary of changes

  • ARM_MUSCA_S1 is the PSA_V8_M target running mbed-os.
  • TF-M secure bootloader (McuBoot) for MUSCA_S1 is submitted as a
    pre-built binary.
  • A post-build hook concatenates The secure and non-secure binaries,
    signs it and then concatenates the bootloader with the signed binary.

Impact of changes

Migration actions required

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

ARM_MUSCA_S1-GCC_ARM_greentea.txt


Reviewers


@ciarmcom ciarmcom requested review from ashok-rao and a team June 26, 2020 15:00
@ciarmcom
Copy link
Member

@gbrtth, thank you for your changes.
@ashok-rao @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers @ARMmbed/mbed-os-core please review.

@gbrtth gbrtth force-pushed the musca_s1_support_mbed6 branch from 7f5b85e to 4b61bb6 Compare July 2, 2020 13:12
@gbrtth
Copy link
Contributor Author

gbrtth commented Jul 3, 2020

Hi,
I have added "device_name": "Musca-S1" in targets.json as this was the device name in the CMSIS pack (<device Dname="Musca-S1">).
However some of the checks fail with the error:
AssertionError: Target ARM_MUSCA_S1 contains invalid device_name Musca-S1

Is it possible that the checks do not see this pack?

@MarceloSalazar
Copy link

@ARMmbed/mbed-os-maintainers please review

"GNUARM"
],
"tfm_delivery_dir": "TARGET_ARM_SSG/TARGET_MUSCA_S1",
"device_name": "Musca-S1",
Copy link
Contributor

@0xc0170 0xc0170 Jul 10, 2020

Choose a reason for hiding this comment

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

Can we get this PR without device_name? Just asking as I dont see it used , or ?

If we need, we shall also update index.json file. This is why it fails, cached object can't find the target. See https://os.mbed.com/docs/mbed-os/v6.0/program-setup/adding-and-configuring-targets.html

Copy link
Contributor Author

@gbrtth gbrtth Jul 15, 2020

Choose a reason for hiding this comment

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

I added device_name on @MarceloSalazar 's request. If it is not necessary for the moment, I can remove it and add it later.

Choose a reason for hiding this comment

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

Please remove it for now so we can get the PR in while we investigate and fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is removed now.

@Patater
Copy link
Contributor

Patater commented Jul 16, 2020

@gbrtth Could I please request also a PR to https://github.com/ARMmbed/mbed-os-tf-m-regression-tests to add the S1? This should make testing (once we integrate those tests with Mbed CI) and updating TF-M within Mbed OS much easier. Thanks.

@mergify
Copy link

mergify bot commented Jul 17, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@adbridge
Copy link
Contributor

@gbrtth This is just a new target so comes in as a patch. Also looks like you need a rebase .

@adbridge adbridge added the release-type: patch Indentifies a PR as containing just a patch label Jul 17, 2020
@gbrtth gbrtth force-pushed the musca_s1_support_mbed6 branch from 4b61bb6 to bbd9dad Compare July 20, 2020 13:27
@mergify
Copy link

mergify bot commented Jul 23, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 27, 2020

@gbrtth Please comment once rebased, to notify reviewers about the update. The rebase is needed again.

@MarceloSalazar this was already reviewed and approved by you (asking if this is now ready for CI and integration) ?

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Change in bbd9dad should be sent via separate pull request. As this is changing the boot up sequence, please send via a new pull request and describe the changes. It should not be part of "adding new target".

This pull request will depend on it.

@MarceloSalazar
Copy link

@MarceloSalazar this was already reviewed and approved by you (asking if this is now ready for CI and integration) ?

Approval subject to tests results. Note we need to see Greentea tests results for both AC6 and GCC ARM.
I understand there is (was?) at least an issue related to TRNG.

@gbrtth can you please upload new test logs once you see all tests passing? Thanks!

@gbrtth
Copy link
Contributor Author

gbrtth commented Jul 28, 2020

@gbrtth can you please upload new test logs once you see all tests passing? Thanks!

There are a few active pull requests to TF-M that needs to be merged to have passing test logs. I can update the PR with the logs, once it is done.

@gbrtth gbrtth force-pushed the musca_s1_support_mbed6 branch from bbd9dad to 361b400 Compare August 7, 2020 17:53
@mergify mergify bot dismissed 0xc0170’s stale review August 7, 2020 17:53

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 12, 2020

There are a few active pull requests to TF-M that needs to be merged to have passing test logs. I can update the PR with the logs, once it is done.

Let us know once it is done and this pull request is ready to proceed

@mergify
Copy link

mergify bot commented Aug 21, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@gbrtth gbrtth force-pushed the musca_s1_support_mbed6 branch from 3574a10 to 21f09a1 Compare September 9, 2020 14:29
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2020

Changes to tools/targets are required? They cause Travis to fail due to changing tools (online compiler won't be updated).

cc @Patater

I'll run CI meanwhile

@gbrtth
Copy link
Contributor Author

gbrtth commented Sep 9, 2020

Changes to tools/targets are required? They cause Travis to fail due to changing tools (online compiler won't be updated).

cc @Patater

I'll run CI meanwhile

If I understand correctly tools/targets/ is the directory, where the keys for Musca-B1 are kept to sign the images. I followed the example and put the S1 keys there.

@mbed-ci
Copy link

mbed-ci commented Sep 9, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

Patater
Patater previously approved these changes Sep 9, 2020
@gbrtth
Copy link
Contributor Author

gbrtth commented Sep 9, 2020

Test logs:
musca_s1_gcc_09_09.txt

@@ -0,0 +1,117 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 Arm Limited
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add SPDX identifiers to new files?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we have CI to catch SPDX missing? What happened with CI?

Copy link
Contributor

@0xc0170 0xc0170 Sep 10, 2020

Choose a reason for hiding this comment

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

Yes, it runs

Copy link
Contributor

Choose a reason for hiding this comment

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

Found files with missing license details, please review and fix
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/i2c_api.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/lp_ticker.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/mbed_serial_platform.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/pinmap.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/serial_api.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/cmsis.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/device_definition.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/device_definition.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/platform_base_address.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/platform_description.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/platform_irq.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/platform_pins.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/platform_regs.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/system_core_init.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/system_core_init.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/cache_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/cache_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/gpio_cmsdk_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/gpio_cmsdk_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/i2c_ip6510_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/i2c_ip6510_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/musca_s1_scc_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/musca_s1_scc_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/qspi_ip6514e_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/qspi_ip6514e_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/timer_cmsdk_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/timer_cmsdk_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/timer_gp_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/timer_gp_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/uart_pl011_drv.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device/drivers/uart_pl011_drv.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/Libraries/mt25ql_flash_lib.c reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/Libraries/mt25ql_flash_lib.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/flash_layout.h reason: Missing SPDX license identifier
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/image_macros_preprocessed_ns.c reason: Missing license header
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/image_macros_preprocessed_s.c reason: Missing license header
File: /targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/partition/region_defs.h reason: Missing SPDX license identifier

Offenders

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll improve Travis reports (new files without a proper license will report error to Travis), I'll create a new PR later today

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the SPDX license identifiers to all the files on the list.

@@ -0,0 +1,215 @@
/* mbed Microcontroller Library
* Copyright (c) 2017-2019 Arm Limited
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't comment above, s_veneers.o is needed? I cant find it used anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is needed. It contains the definitions of the tfm veneer functions, which are used to call the tfm services from the non-secure code.

@@ -0,0 +1,76 @@
/* mbed Microcontroller Library
Copy link
Contributor

Choose a reason for hiding this comment

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

also mcu_boot.bin (in the target folder), is part of this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is also needed, mcuboot.bin is used in tools\targets\ARM_MUSCA_S1.py

@@ -0,0 +1,137 @@
/* mbed Microcontroller Library
* Copyright (c) 2017-2019 Arm Limited
*
Copy link
Contributor

Choose a reason for hiding this comment

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

SPDX here , in all hal implementation files

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2020

@gbrtth Only small changes requested. If they are fixed, we can restart CI as soon as possible to have this ready by later today.

gbrtth and others added 2 commits September 10, 2020 14:53
Change-Id: Iebdd4bc402446caba6b7bd894eddb0a85ed884d8
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
Signed-off-by: Gabor Toth <gabor.toth@arm.com>
Change-Id: Ib0d207d4ca22ae239f6b40b95618b66eb329a29c
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
@gbrtth gbrtth force-pushed the musca_s1_support_mbed6 branch from 21f09a1 to 37f2669 Compare September 10, 2020 13:06
@mergify mergify bot dismissed stale reviews from 0xc0170 and Patater September 10, 2020 13:08

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 10, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2020

Travis will start soon

@mergify mergify bot added needs: work and removed needs: CI labels Sep 10, 2020
@0xc0170 0xc0170 merged commit 6bfd89e into ARMmbed:master Sep 10, 2020
@mergify mergify bot removed the ready for merge label Sep 10, 2020
@mbedmain mbedmain added release-version: 6.3.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Sep 14, 2020
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.

9 participants