Skip to content

Export: Support Make + ArmC6 + v8m #7559

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 5 commits into from
Aug 10, 2018

Conversation

theotherjimmy
Copy link
Contributor

Description

There were a few issues preventing v8m support for make_armc6:
* a -D flag with (...) in it
* the wrong scatterfile was used, making use of armcc in
the preprocessing step

This PR fixes both of these issues.

Pull request type

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

@theotherjimmy
Copy link
Contributor Author

@deepikabhavnani @cmonr Could one of you verify that this works on windows?

@deepikabhavnani
Copy link

@theotherjimmy - I tried the commit for v8 devices and it fails with error

"Compile: main_s.cpp"
armclang '-fno-rtti' '-std=gnu++98' '-include' './mbed_config.h' '-DTARGET_M2351KIAAEES' '-D__MBED__=1' '-DDEVICE_I2CSLAVE=1' '-DTARGET_LIKE_MBED' '-DDEVICE_PORTOUT=1' '-DDEVICE_PORTINOUT=1' '-D__MBED_CMSIS_RTOS_CM' '-DDEVICE_RTC=1' '-DDEVICE_SERIAL_ASYNCH=1' '-D__CMSIS_RTOS' '-DTOOLCHAIN_ARMC6' '-DTARGET_FLASH_CMSIS_ALGO' '-D__CORTEX_M23' '-DDEVICE_I2C_ASYNCH=1' '-DTARGET_CORTEX_M' '-DTARGET_DEBUG' '-DTARGET_UVISOR_UNSUPPORTED' '-DDEVICE_LPTICKER=1' '-DTARGET_NUVOTON' '-DDEVICE_INTERRUPTIN=1' '-DTARGET_CORTEX' '-DDEVICE_I2C=1' '-DTARGET_NUMAKER_PFM_M2351' '-DTARGET_M23' '-DDEVICE_STDIO_MESSAGES=1' '-DDEVICE_SPI_ASYNCH=1' '-DTARGET_LIKE_CORTEX_M23' '-DDEVICE_SERIAL=1' '-DDEVICE_USTICKER=1' '-DTARGET_M2351' '-DDEVICE_PORTIN=1' '-DDEVICE_SLEEP=1' '-DMBED_BUILD_TIMESTAMP=1532101495.47' '-DMBED_FAULT_HANDLER_DISABLED' '-DDEVICE_SPI=1' '-DARM_MATH_ARMV8MBL' '-DDEVICE_SPISLAVE=1' '-DDEVICE_ANALOGIN=1' '-DDEVICE_PWMOUT=1' '-DLPTICKER_DELAY_TICKS=3' '-DMBED_TZ_DEFAULT_ACCESS=1' '-DDEVICE_FLASH=1' '-DTOOLCHAIN_ARM' '-DTOOLCHAIN_ARM_STD' '-DDEVICE_SERIAL_FC=1' '-include' './mbed_config.h' '-c' '--target=arm-arm-none-eabi' '-mthumb' '-g' '-O0' '-Wno-armcc-pragma-push-pop' '-Wno-armcc-pragma-anon-unions' '-DMULADDC_CANNOT_USE_R7' '-fdata-sections' '-fno-exceptions' '-MMD' '-D_LIBCPP_EXTERN_TEMPLATE(...)=' '-mcpu=cortex-m23' '-march=armv8-m.base' '-mcmse' '-fno-rtti' '-std=gnu++98' '-DAPPLICATION_ADDR=0x0' '-DAPPLICATION_SIZE=0x40000' '-DAPPLICATION_RAM_ADDR=0x20000000' '-DAPPLICATION_RAM_SIZE=0x8000' '-DMBED_ROM_START=0x0' '-DMBED_ROM_SIZE=0x40000' -I../. -o main_s.o ../main_s.cpp
../main_s.cpp:2:10: fatal error: 'mbed.h' file not found
#include "mbed.h"
         ^~~~~~~~
1 error generated.
make[1]: *** [main_s.o] Error 1
make: *** [all] Error 2

@theotherjimmy
Copy link
Contributor Author

Thanks. We'll talk offline about how to resolve this.

@theotherjimmy
Copy link
Contributor Author

@deepikabhavnani and I found out that a call to win_to_unix will not work correctly WRT include paths on windows. This has been remedied in the "Correct path handling after calls to win_to_unix" commit.

@deepikabhavnani Could you test this PR again when you get the chance?

@theotherjimmy theotherjimmy force-pushed the make-armc6-v8m branch 3 times, most recently from c2d00d5 to 881803c Compare July 20, 2018 18:19
@deepikabhavnani
Copy link

deepikabhavnani commented Jul 20, 2018

Failing at linking step now:

"Compile: spi_api.c"
"Compile: trng_api.c"
"Compile: us_ticker.c"
"Compile: nu_miscutil.c"
"Compile: nu_modutil.c"
"link: 7559_export_test.elf"
The system cannot execute the specified program.
make[1]: *** [7559_export_test.elf] Error 1
make: *** [all] Error 2

@theotherjimmy
Copy link
Contributor Author

@deepikabhavnani Can you run armlink from your command line? it seem that this is another one of those failures.

@deepikabhavnani
Copy link

@theotherjimmy - yes i can run armlink from command line and I did verify ARMC6 path as well

@theotherjimmy
Copy link
Contributor Author

@deepikabhavnani Then it's probably fixed by #7583

@deepikabhavnani
Copy link

#6335

@deepikabhavnani
Copy link

Still same error on windows system


"link: 7559_export_test.elf"
The system cannot execute the specified program.
make[1]: *** [7559_export_test.elf] Error 1
make: *** [all] Error 2

Error on linux
C/CPP file compilation was successful, asm files throw below error

2 warnings generated.
Assemble: except.S
Warning: A3912W: Option 'c' is deprecated.
Fatal error: A3903U: Argument 'Cortex-M23' not permitted for option 'cpu'.
1 Error, 1 Warning
/home/deepika/test_7559/Makefile:1038: recipe for target 'mbed-os/rtos/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o' failed
make[1]: *** [mbed-os/rtos/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o] Error 8
Makefile:25: recipe for target 'all' failed
make: *** [all] Error 2

Config setting in linux
deepika@deepika:~/test_7559$ mbed config -G --list
[mbed] Global config:
GCC_ARM_PATH=/home/deepika/gcc-arm-none-eabi-7-2018-q2-update/bin/
ARMC6_PATH=/usr/local/ARMCompiler6.10/bin/

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ARM_Compiler_5.06u6/bin64:/usr/local/iccarm-7.80.1/bin:/usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin:/usr/local/ARMCompiler6.10/bin:/snap/bin

which armclang
/usr/local/ARMCompiler6.10/bin/armclang

which armasm
/usr/local/ARM_Compiler_5.06u6/bin64/armasm

@deepikabhavnani
Copy link

deepikabhavnani commented Aug 7, 2018

@theotherjimmy
Linux build was successful if $PATH contains ARMC6 path, if path of ARM compiler 5 and ARM compiler 6 both are set, build fails during assembly file compilation. Can we add this to documents?

Also, srec_cat is the requirement for merging hex files do we capture that anywhere in docs?

CC @AnotherButler

Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Verified works for linux. Know issue for windows (command length exceeds 32K during linking)

@cmonr
Copy link
Contributor

cmonr commented Aug 9, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 9, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Aug 9, 2018

@mbed-ci
Copy link

mbed-ci commented Aug 9, 2018

@cmonr
Copy link
Contributor

cmonr commented Aug 9, 2018

/morph test

@AnotherButler
Copy link
Contributor

AnotherButler commented Aug 9, 2018

@deepikabhavnani To my knowledge, we don't capture that in the docs.

@mbed-ci
Copy link

mbed-ci commented Aug 10, 2018

@0xc0170 0xc0170 merged commit 2a824a1 into ARMmbed:master Aug 10, 2018
pan- pushed a commit to pan-/mbed that referenced this pull request Aug 22, 2018
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.

8 participants