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

Fix build tool with ARMC6/ARMv8M #6644

Merged
merged 3 commits into from Apr 27, 2018

Conversation

Projects
None yet
6 participants
@ccli8
Contributor

ccli8 commented Apr 16, 2018

Description

This PR tries to fix build tool issues with ARMC6/ARMv8M:

  1. Add linking time preprocessor macro __DOMAIN_NS for non-secure build
  2. For output .hex format, combine multiple .hex files (for multiple load regions) into one. This can help for Greentea test.
  3. Fix None build_dir error with cmse_lib.o on Greentea test. None build_dir is passed to ARMC6 > __init__ and causes error from:
    mbed-os/tools/test_api.py:
     def find_tests(base_dir, target_name, toolchain_name, app_config=None):
     ......
         # Temporary structure: tests referenced by (name, base, group, case) tuple
         tests = {}
         # List of common folders: (predicate function, path) tuple
         commons = []
    
         # Prepare the toolchain
         toolchain = prepare_toolchain([base_dir], None, target_name,
     
    I move cmse_lib.o from ARMC6 > __init__ to ARM > link.

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

Fix build tool with ARMC6/ARMv8M
1. Add linking time preprocessor macro __DOMAIN_NS for non-secure build
2. For output .hex format, combine multiple .hex files (for multiple load regions) into one
   This can help for Greentea test.
3. Fix 'None' build_dir with cmse_lib.o on Greentea test
@@ -233,6 +233,11 @@ def link(self, output, objects, libraries, lib_dirs, scatter_file):
cmd_pre = self.ld + args
cmd = self.hook.get_cmdline_linker(cmd_pre)
# Create Secure library
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":

This comment has been minimized.

@theotherjimmy

theotherjimmy Apr 16, 2018

Contributor

Moving this here breaks exporters: The exporters have to know to append these options somehow, and this location prevents them from being able to.

@@ -252,7 +257,8 @@ def archive(self, objects, lib_path):
@hook_tool
def binary(self, resources, elf, bin):
_, fmt = splitext(bin)
bin_arg = {".bin": "--bin", ".hex": "--i32"}[fmt]
# On .hex format, combine multiple .hex files (for multiple load regions) into one
bin_arg = {".bin": "--bin", ".hex": "--i32combined"}[fmt]

This comment has been minimized.

@theotherjimmy

theotherjimmy Apr 16, 2018

Contributor

Good catch. This was always the indented behavior. I guess nobody combined multiple load regions with hex output before.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 16, 2018

@ccli8 I'm familiar with the interaction between the toolchains and the exporters and the toolchains and the test builder. Let me know if you would like me to correct the "no build dir" bug.

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Apr 17, 2018

@theotherjimmy Yes. Please correct the "no build dir" bug and I can check Grrentea flow on NUMAKER_PFM_M2351 with the corrected version. NUMAKER_PFM_M2351 is Cortex-M23 based and its port is on-going.

@cmonr cmonr added needs: work and removed needs: review labels Apr 17, 2018

@theotherjimmy theotherjimmy force-pushed the OpenNuvoton:nuvoton_fix_armc6_armv8m branch 5 times, most recently from 4d1e335 to 5e83ae9 Apr 17, 2018

@theotherjimmy theotherjimmy force-pushed the OpenNuvoton:nuvoton_fix_armc6_armv8m branch 2 times, most recently from fef7297 to bc8b983 Apr 17, 2018

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 17, 2018

@ccli8 I changed the implementation on your branch. Good news: it reduced the diff by quite a bit.

@deepikabhavnani

Looks good to me 👍

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Apr 18, 2018

@theotherjimmy With your update, I run Greentea test on NUMAKER_PFM_M2351 with ARMC6 and it works.

@0xc0170 0xc0170 removed the needs: work label Apr 18, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 18, 2018

/morph build

@0xc0170 0xc0170 added the needs: CI label Apr 18, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Apr 18, 2018

Build : SUCCESS

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

Triggering tests

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

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 18, 2018

/morph uvisor-test

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 19, 2018

/morph test
/morph uvisor-test

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 19, 2018

@kegilbert @theotherjimmy Can you review the logs from the test failures?

I could find 02:46:31 mbedgt: no platform/target matching tests were found! , but why does it fail? Is it related to this change? No tests run.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Apr 23, 2018

Did some link hopping,

  1. http://mbed-ci-master-2.austin.arm.com:8081/job/test_matrix_raas/1602/target=K64F,toolchain=GCC_ARM/console

  2. http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6644/PASS/K64F/GCC_ARM

  3. http://mbed-os.s3-eu-west-1.amazonaws.com/builds/6644/PASS/K64F/GCC_ARM/bc8b98358d5ee1e5c986d263ed8874fa5a1e2aa4_example_build_log_K64F_GCC_ARM.txt

  4. http://mbed-os.s3-eu-west-1.amazonaws.com/builds/6644/PASS/K64F/GCC_ARM/bc8b98358d5ee1e5c986d263ed8874fa5a1e2aa4_build_log_K64F_GCC_ARM.txt

and noticed a couple of things:

  • The build log (3) has it's mem table filled out, whereas compilation for the test (4) looks like this:
Memory map breakdown for built projects (values in Bytes):
+------+--------+-----------+------------+-------------+
| name | target | toolchain | static_ram | total_flash |
+------+--------+-----------+------------+-------------+
+------+--------+-----------+------------+-------------+
  • This is the command used to compile the test:
mbed test --compile -m K64F -t GCC_ARM -DMBED_HEAP_STATS_ENABLED=1 -DMBED_STACK_STATS_ENABLED=1 -DMBED_TRAP_ERRORS_ENABLED=1 -DMBED_TEST_BLOCKDEVICE=SPIFBlockDevice -DMBED_TEST_BLOCKDEVICE_DECL=SPIFBlockDevice bd(D11,D12,D13,D10)

MBED_TEST_BLOCKDEVICE_DECL should not have a space...

@cmonr cmonr added needs: work and removed needs: CI labels Apr 23, 2018

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Apr 24, 2018

@theotherjimmy I find something wrong with the commit bc8b983. Test items are not listed with the command:

mbed test -m NUMAKER_PFM_NUC472 -t ARM --compile-list

If I roll back, it is OK.

Correct test finding behavior
Scan resources ignores the build dir so we can't set it to something
dumb like the directory we want to scan
@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 24, 2018

Crap. I forgot that the resource scan ignores the assigned build directory. Sorry about that. Fixing now.

@theotherjimmy theotherjimmy dismissed stale reviews from 0xc0170, deepikabhavnani, and themself via da69f01 Apr 24, 2018

@cmonr

cmonr approved these changes Apr 24, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Apr 24, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Apr 24, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Apr 26, 2018

@theotherjimmy The issue gets fixed with your update da69f01.

mbed test -m NUMAKER_PFM_NUC472 -t ARM --compile-list

@cmonr cmonr merged commit 1f259a4 into ARMmbed:master Apr 27, 2018

12 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9547 cycles (+464 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 10112B (+0.00%)
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the ready for merge label Apr 27, 2018

@ccli8 ccli8 deleted the OpenNuvoton:nuvoton_fix_armc6_armv8m branch Apr 27, 2018

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