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

Build tool fixes for Musca support #7792

Merged
merged 5 commits into from Aug 28, 2018

Conversation

Projects
None yet
6 participants
@deepikabhavnani
Contributor

deepikabhavnani commented Aug 14, 2018

Description

Typos and minor fixes required to support Cortex-M33 devices. Support of M33 was not tested since we didn;t had any target. This PR will be tested internally with MUSCA.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Feature
[ ] Breaking change

@deepikabhavnani deepikabhavnani requested a review from theotherjimmy Aug 14, 2018

@cmonr

LGTM, just some questions

self.flags['common'].append("-mcpu=%s" % target.core.lower())
self.flags['ld'].append("--cpu=%s" % target.core.lower())
self.SHEBANG += " -mcpu=%s" % target.core.lower()
if not target.core.startswith("Cortex-M23") and not target.core.startswith("Cortex-M33"):

This comment has been minimized.

@cmonr

cmonr Aug 15, 2018

Contributor

Hmm, so I take it building for the NS side no longer needs to be differentiated?

This comment has been minimized.

@deepikabhavnani

deepikabhavnani Aug 15, 2018

Contributor

Differentiation is still there, here we are just not setting ‘-mcpu’ parameter for any of v8M device. If we set cpu as cortex-m33 in flags, compiler enables dsp as well which is optional. Hence we just set ‘-march’

This comment has been minimized.

@theotherjimmy

theotherjimmy Aug 15, 2018

Contributor

Please collapse the

else:
    if: ...

into

elif:
@@ -256,8 +256,6 @@ def link(self, output, objects, libraries, lib_dirs, mem_map):
# Exec command
self.notify.cc_verbose("Link: %s" % ' '.join(cmd))
self.default_cmd(cmd)
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":

This comment has been minimized.

@cmonr

cmonr Aug 15, 2018

Contributor

Why is this output no longer needed? (Commit only mentioned something about a build issue)

This comment has been minimized.

@deepikabhavnani

deepikabhavnani Aug 15, 2018

Contributor

Code for creation of ‘secure_file’ was initially in this section and later moved to other part. Variable ‘secure_file’ is not available here and hence throws error

@cmonr cmonr added the needs: review label Aug 15, 2018

-mcpu option not needed for v8M devices
-mcpu option if set for v8M CPU;s it will add DSP feature as default
which is optional. Hence setting just the architecture for Cortex-M23
and Cortex-M33

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:fix_m33 branch from a84ebee to beab422 Aug 15, 2018

Arch and CPU options for linker and Clang are different for Cortex-M33
As per the link below, options for clang and armlink are diferrent for Cortex-M33
armlink --cpu 8-M.Main --import-cmse-lib-out importlib_v1.o
armclang -march=armv8-m.main -mcmse

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0773h/pge1452794854109.html
@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 16, 2018

Fix in 6366452 : Options for clang and armlink are diferrent for Cortex-M33

armlink --cpu 8-M.Main --import-cmse-lib-out importlib_v1.o
armclang -march=armv8-m.main -mcmse

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0773h/pge1452794854109.html

cc @gaborkertesz

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 16, 2018

@theotherjimmy - We have few issues while building ASM files. All the C flags are added to asm build, as a result .o generated is not correct.

Compile: C:\Program Files\ARMCompiler6.10\bin\armasm --cpu=8-M.Main --cpreproc --**cpreproc_opts=-c**,--target=arm-arm-none-eabi,-mthumb,-Os,-Wno-armcc-pragma-push-pop,-Wno-armcc-pragma-anon-unions,-DMULADDC_CANNOT_USE_R7,-fdata-sections,-fno-exceptions,-MMD,-D_LIBCPP_EXTERN_TEMPLATE(...)=,-D__STARTUP_COPY_MULTIPLE,-D__CORTEX_M33,-DMBED_FAULT_HANDLER_DISABLED,-D__MBED_CMSIS_RTOS_CM,-D__STARTUP_CLEAR_BSS,-D__CMSIS_RTOS,-DARM_MATH_ARMV8MML,-I.,-I.\mbed-os,-I.\mbed-os\cmsis,-I.\mbed-os\cmsis\TARGET_CORTEX_M,-I.\mbed-os\drivers,-I.\mbed-os\events,-I.\mbed-os\events\equeue,-I.\mbed-os\features,-I.\mbed-os\features\cellular,-I.\mbed-os\features\cellular\easy_cellular,

[DEBUG] Output: armclang.exe: warning: .\mbed-os\targets\TARGET_ARM_SSG\TARGET_MUSCA_A1\TOOLCHAIN_ARMC6\startup_cmsdk_musca.s: 'assembler' input unused [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-mthumb' [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-Wno-armcc-pragma-push-pop' [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-Wno-armcc-pragma-anon-unions' [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-D MULADDC_CANNOT_USE_R7' [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-fdata-sections' [-Wunused-command-line-argument]
[DEBUG] Output: armclang.exe: warning: argument unused during compilation: '-fno-exceptions' [-Wunused-command-line-argument]
Remove deprecated linker options
Resolved below warnings
Warning: L3912W: Option 'legacyalign' is deprecated.
Warning: L3912W: Option 'no_strict_wchar_size' is deprecated.
Warning: L3912W: Option 'no_strict_enum_size' is deprecated.
@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 17, 2018

We have few issues while building ASM files. All the C flags are added to asm build, as a result .o generated is not correct.

Issue relate to ASM file build was related to assembly file extension ".s", and is resolved by updating it to be caps .S

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 17, 2018

@theotherjimmy @gaborkertesz - Please review

@deepikabhavnani deepikabhavnani requested a review from gaborkertesz Aug 20, 2018

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:fix_m33 branch from e9d53ab to 3fcf14e Aug 22, 2018

@gaborkertesz

This comment has been minimized.

Contributor

gaborkertesz commented Aug 22, 2018

Basic hello world example has been tested with armclang and gcc on Musca and working as expected as a secure only application.

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 22, 2018

@theotherjimmy @cmonr - Please review

self.flags['c'].append("-mcpu=cortex-m33+nodsp")
self.flags['c'].append("-mfpu=none")
self.flags['cxx'].append("-mcpu=cortex-m33+nodsp")
self.flags['cxx'].append("-mfpu=none")

This comment has been minimized.

@theotherjimmy

theotherjimmy Aug 23, 2018

Contributor

Can these be added to common?

This comment has been minimized.

@deepikabhavnani

deepikabhavnani Aug 23, 2018

Contributor

Done 👍

if target.core == "Cortex-M23" or target.core == "Cortex-M33":
self.flags['common'].append("-mcmse")
self.flags['cxx'].append("-mcmse")
self.flags['c'].append("-mcmse")

This comment has been minimized.

@theotherjimmy

theotherjimmy Aug 23, 2018

Contributor

Could this be added to common?

This comment has been minimized.

@deepikabhavnani

deepikabhavnani Aug 23, 2018

Contributor

This flag gives warning with linker and armasm.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 23, 2018

I got one question - removing those legacy flags from linker command - the warning is for ARMC6 only (can't be seen in ARMC5) ? This is safe to remove, no functionality change?

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 23, 2018

I got one question - removing those legacy flags from linker command

Legacy linker flags are not present for ARM 5 compiler,
https://github.com/ARMmbed/mbed-os/pull/7792/files#diff-84bdeb5b184eec3910a5d6a23df9ceccL35

I don;t see those flags even in history of ARM 5 compiler, @theotherjimmy - any idea why those flags were added for ARMC6.

This is safe to remove

Should be, as they have no impact. Deprecated as per this link http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0381b/CHDHCGGF.html

Disabling DSP and FPU for Cortex-M33
Change shared by @gabor Kertesz

Hard-fault on Musca was because of enabled floating point instructions,
disabling DSP and FPU.

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:fix_m33 branch from 3fcf14e to ed58ff0 Aug 23, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 23, 2018

@theotherjimmy - I also see below warning in detail build dumps, not sure what is causing this.

[DEBUG] Errors: warning: 'armv4t' is unsupported in this version of the product

@cmonr cmonr added the risk: G label Aug 24, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 27, 2018

Can we start the build for this PR?

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 27, 2018

Does #7792 (comment) not need to be addressed?

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 27, 2018

Does #7792 (comment) not need to be addressed?

Its warning, can be fixed later as well. Musca is dependent on this fix for now. Added issue to handle it later #7900

@cmonr

This comment has been minimized.

Contributor

cmonr commented Aug 27, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Aug 27, 2018

Build : SUCCESS

Build number : 2933
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7792/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

cmonr approved these changes Aug 28, 2018

@cmonr

cmonr approved these changes Aug 28, 2018

@cmonr cmonr merged commit 14319ad into ARMmbed:master Aug 28, 2018

14 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0.0%) RAM(+0.0%)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud_client_smoke_test Test job was successful
Details
travis-ci/astyle Passed, 585 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9943 cycles (+745 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@0xc0170 0xc0170 removed the needs: CI label Aug 28, 2018

@cmonr cmonr removed the risk: G label Sep 2, 2018

@0xc0170 0xc0170 referenced this pull request Sep 5, 2018

Closed

ARMC6: legacy align error #8004

@deepikabhavnani deepikabhavnani deleted the deepikabhavnani:fix_m33 branch Sep 28, 2018

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