Skip to content

Initial support for Cortex M-23/M-33 devices. #4875

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 11, 2017

Conversation

deepikabhavnani
Copy link

@deepikabhavnani deepikabhavnani commented Aug 8, 2017

Added RTX + tools support for GCC only.

IAR 7.8 Cortex-23 does not support exclusive and secure commands. Move to IAR 8.0 requires changed in either Thread class or CMSIS (Ideal would be CMSIS). Hence dropping IAR in this PR

Required for : Rebased Nuvoton code for M2351 - PR #4892
Dependent on IAR 8.0 support

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 9, 2017

Look at travis failure, looks like there's assembly file not using uppercase suffix.

Would this be easier if this patch would be split into two (generic M-23/M-33, and then nuvoton on top of it) ?

IAR 7.8 Cortex-23 seems to have Non-secure commands supported only.

Will IAR 8.x help there?

@@ -42,7 +42,7 @@
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-On", "-r", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": [],
"c": ["--vla"],
Copy link
Contributor

Choose a reason for hiding this comment

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

why suddenly are not compatible ? This flag is only for C compiler ,thus should not cause any errors (we used to have it in common, and then I recall we faced an error with compatilibity , probably the same one you are seeing?) . See #1985 why it was enabled.

This commit should be a separate pull request

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, you are correct. I tried using them in common location at *.json files and got errors. Will verify once.

Copy link
Author

Choose a reason for hiding this comment

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

My bad, I was getting compilation issues with exporters when enabling "--c++", "--no_rtti", "--no_exceptions" flags in *.json files. Compile flags and exporter flags didn't seemed synchronized.

"--no_rtti", "--no_exceptions" - Not working with export tool. Enabling those flags directly in project settings work, but updating the template files didn't help as well. Verified now, the *.ewp file version for IAR8 is 3 and we are using version 2. Migration required.

Will remove this commit and add bug to mbed-os

@@ -23,12 +23,6 @@
#include "platform/mbed_assert.h"
#include "platform/mbed_toolchain.h"

#if !defined (__CORTEX_M0) && !defined (__CORTEX_M0PLUS)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 , can this be send separately? Should be quick to integrate, and then just rebase your branch to get it in

Copy link
Author

Choose a reason for hiding this comment

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

PR #4902, will remove and rebase shortly

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 17, 2017

cc @theotherjimmy

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 17, 2017

IAR 7.8 Cortex-23 does not support exclusive and secure commands. Move to IAR 8.0 requires changed in either Thread class or CMSIS (Ideal would be CMSIS). Hence dropping IAR in this PR

Can you elabore this dependency? What is expected to be delivered and who is taking an action item to do so?

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

Tools changes look fine.

@deepikabhavnani
Copy link
Author

Rebased on top of #4902

@deepikabhavnani deepikabhavnani requested a review from sg- August 17, 2017 15:24
@deepikabhavnani
Copy link
Author

@0xc0170 - I am looking into IAR changes with CMSIS team, but might get delayed due to vacation time.

@deepikabhavnani
Copy link
Author

Rebased on top of IAR_fix branch

@@ -37,7 +37,8 @@
#define CTHUNK_ADDRESS 1
#define CTHUNK_VARIABLES volatile uint32_t code[2]

#if (defined(__CORTEX_M3) || defined(__CORTEX_M4) || defined(__CORTEX_M7) || defined(__CORTEX_A9))
#if (defined(__CORTEX_M3) || defined(__CORTEX_M4) || defined(__CORTEX_M7) || defined(__CORTEX_A9) \
|| defined(__CORTEX_M23) || defined(__CORTEX_M33))
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work? I would have guessed that the M23 needed to be aligned with the M0/P version

Copy link
Author

Choose a reason for hiding this comment

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

Armv8-M architecture reference manual has new term now for Thumb instructions. It says v8-M variant supports T32 instruction set and does not distinguish between mainline (M-33) and baseline (M-23) architecture.
All instructions are decoded as T32 (not as 16-bit Thumb has to be aligned to half word).

Also, callbacks in test were successful.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2017

LGTM, waiting for IAR 8.x support, will tag this accordingly.

@mbed-bot
Copy link

mbed-bot commented Sep 7, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1250

Build failed!

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

mbed-bot commented Sep 7, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1254

Build Prep failed!

@studavekar
Copy link
Contributor

Looks like git fetch error from github

0:00:01.528 using GIT_SSH to set credentials 
00:00:02.162  > git fetch --no-tags --progress [email protected]:ARMmbed/mbed-os.git +refs/heads/*:refs/remotes/origin/* # timeout=20
00:19:43.472 ERROR: Error cloning remote repo 'origin'
00:19:43.473 hudson.plugins.git.GitException: Command "git fetch --no-tags --progress [email protected]:ARMmbed/mbed-os.git +refs/heads/*:refs/remotes/origin/*" returned status code 1:
00:19:43.473 stdout: 

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

mbed-bot commented Sep 8, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1259

Build failed!

@deepikabhavnani
Copy link
Author

IAR license issue

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

mbed-bot commented Sep 9, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1263

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2017

Testing Done, however as this has dependency on another PR, this will require rebase once that goes on, and retest again

If we can (me or someone) do that rebase (push to your branch), would be good in case you are not around

Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

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

The irq_armv8mml and etc. files were copied from CMSIS, but to file paths that are different than in upstream CMSIS. Please be sure to update any file path mapping scripts or documentation (cc @bulislaw)

if target.core == "Cortex-M23" or target.core == "Cortex-M23-NS":
self.cpu.append("-march=armv8-m.base")
elif target.core == "Cortex-M33" or target.core == "Cortex-M33-NS":
self.cpu.append("-march=armv8-m.main")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider adding:
self.cpu.append("-mcmse")

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

@@ -884,6 +884,9 @@ extern "C" WEAK void __iar_file_Mtxinit(__iar_Rmtx *mutex) {}
extern "C" WEAK void __iar_file_Mtxdst(__iar_Rmtx *mutex) {}
extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {}
extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {}
#if (__IAR_SYSTEMS_ICC__ >= 8)
extern "C" WEAK void *__aeabi_read_tp (void) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is an empty implementation really sufficient? Do the TLS tests still pass with this empty implementation?

Copy link
Author

Choose a reason for hiding this comment

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

TLS (Thread local storage support) is not yet added to mbed-os

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

@adbridge
Copy link
Contributor

@Patater Could your review comments go on a separate PR that we get into RC2 ?

@deepikabhavnani
Copy link
Author

Rebased after IAR changes were merged

@deepikabhavnani
Copy link
Author

@Patater - Added security flag. Will check with @bulislaw regarding file path mapping scripts or documentation

@deepikabhavnani
Copy link
Author

/morph test

@Patater
Copy link
Contributor

Patater commented Sep 11, 2017

@adbridge @bulislaw @deepikabhavnani

Yes, the "file path mapping scripts and documentation" changes can go into a separate PR.

Thanks!

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1280

All builds and test passed!

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