-
Notifications
You must be signed in to change notification settings - Fork 3k
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
M2354: Support Nuvoton's new target #14441
Conversation
mbed-os-tf-m-regression-tests/TF-M regression test
|
Greentea test (ARMC6)
Greentea test (GCC_ARM)
|
FPGA CI Test Shield test (ARMC6)
FPGA CI Test Shield test (GCC_ARM)
|
@ccli8, thank you for your changes. |
Update? |
@ccli8 Please review travis failure - license missing in some files |
1aad2bd
to
9ceb6f7
Compare
Added missing license headers. However, meet another CI failure with frozen files |
@Patater Please review |
@Patater , both of MUSCA and M2354 platforms green-tea test still need the frozen files for post -build. How about to disable this frozen file check before CLI2 can fully replace. |
@cyliangtw What would we need to do to make this work with Mbed CLI 2? What are the deficiencies of Mbed CLI 2 here? |
@Patater Cureently, Mbed CLI2 doesn't support Greentea test yet (or not release yet)? Besides, not all samples, especially custom ones, have supported Mbed CLi2. |
All official examples are supported with Mbed CLI 2 now, and will be released with Mbed OS 6.10. We are working on enabling Greentea integration with Mbed CLI 2. If there are any other issues or things holding up migration to Mbed CLI 2, please let us know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xc0170
I've reviewed the frozen tools files. The files modified will impact the online compiler (tools/targets/__init__.py
, tools/export/uvision/__init__.py
). However, the risk is low enough we can merge without a passing "Frozen tools check".
9ceb6f7
to
78f5aab
Compare
Following ARMmbed/mbed-tools#222 (comment), use TF-M exported |
Navigate [TF-M](https://www.trustedfirmware.org/projects/tf-m/). | ||
Then go through **DOCS** → **Getting Started Guides** → **Software requirements** for TF-M build environment setup. | ||
|
||
**NOTE**: For unknown reason, **GNU Arm Embedded Toolchain 10-2020-q4-major** built code **FAILS** to run. Avoid this toolchain version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this reported anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. The cause is unknown. The TF-M is built on GNU Arm Embedded Toolchain 9-2020-q2-update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xc0170 Unfortunately we need to avoid 10-2020-q4-major, see https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/9284. It's fixed in the development version of GCC but we don't know when a newer release will come.
@ccli8 Does it looks related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we didn't get to the root cause 10-2020-q4-major failing. Just cross-check and do no gcc compiler upgrade to this version.
1. Configure non-secure target name to NU_M2354 (targets/targets.json). No NU_M2354_NS alias 2. Following template target, enable image signing and concatenating in post-build process (1) Add post-build script (tools/targets). (2) Enable TF-M custom build by centralize relevant stuff imported from TF-M (COMPONENT_TFM_S_FW). 3. Add M2354Code.merge_secure into whitelist of uvision6 (tools/export/uvision/__init__.py). 4. Add M2354 CMSIS pack database (tools/arm_pack_manager/index.json). 5. Configure stdio baudrate to 115200 to match TF-M port (platform/mbed_lib.json). 6. Define CMSIS_NVIC_VIRTUAL to override NVIC_SystemReset with TF-M version (cmsis_nvic_virtual.h). 7. Override tfm_ns_interface_xxx(...) to enable NS secure call: (1) At pre-rtos stage (2) In SVC context 8. Implement secure function call with tfm_platform_ioctl(...). 9. Combine stddriver_secure.h/c and hal_secure.h/c into platform_extra_secure.h/c. 10. Fix peripheral base to non-secure (PeripheralNames.h) (TrustZone-unaware since Mbed OS 6.0). 11. Fix NU_PORT_BASE/NU_GET_GPIO_PIN_DATA/NU_SET_GPIO_PIN_DATA to non-secure (PinNamesCommon.h) (TrustZone-unaware since Mbed OS 6.0). 12. NSC convention for StdDriver sys/clk (both TF-M and Mbed must follow) (1) SYS_ResetModule Usage: Replaced with SYS_ResetModule_S on Mbed OS Action: Make it inaccessible from Mbed (neither source nor NSC). Provide SYS_ResetModule_S on Mbed via platform ioctl instead. (2) CLK_GetXxx Usage: Called in bpwm/i2s/qspi/sc/sdh and system_M2354 on Mbed OS Action: Make them inaccessible from Mbed (neither source nor NSC). Re-provide them on Mbed via platform ioctl instead. 13. Remove DISABLE/ENABLE macro definitions in BSP to avoid name conflict with other modules 14. Change to TMR4/5 from TMR2/3 for implementing us_ticker/lp_ticker because TMR2 is used for TF-M NSPE test 15. Support cmake NOTE: Export(uvision6) doesn't support TF-M target. To enable it for partial compile on Keil, force below function to return true. is_target_supported(tools/export/uvision/__init__.py)
Enable serial sync with the below PR: ARMmbed#14600
1. Enable mcuboot no padding option 2. Support output image format Intel Hex
1. Update TF-M Secure bin enabling TRNG as entropy source 2. Replaced with above, remove TRNG HAL stuff on Mbed, including platform extra secure functions, cmake, etc.
Pull request has been modified.
@LDong-Arm Done with rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(Frozen tools check shouldn't have passed - we have an issue in Travis that caused it to always pass, I'll fix it separately. This shouldn't affect this PR, so I think we can run CI it and get it merged.) |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
@ARMmbed/mbed-os-maintainers This PR is ready for merge. |
Summary of changes
M2354,is Nuvoton's CM23 based and TrustZone enabled chip. Based on TF-M 1.3 release, this PR enables TF-M 1.3 on Mbed OS 6.
Mbed CLI build:
Mbed CLI2 build:
Pull request type
Test results