Skip to content

Add target for Big-endian ARM Cortex-R4F/R5F MCUs #50813

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
May 20, 2018
Merged

Add target for Big-endian ARM Cortex-R4F/R5F MCUs #50813

merged 2 commits into from
May 20, 2018

Conversation

paoloteti
Copy link
Contributor

The ARM Real-Time (‘R’) profile provides high-performing processors for safety-critical environments.

Cortex-R has ARM, Thumb instruction whereas Cortex-M makes use of Thumb only.

CI/Dockerfile is intentionally in the disabled folder.

The ARM Real-Time (‘R’) profile provides high-performing processors
for safety-critical environments.
@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 16, 2018
@nikomatsakis
Copy link
Contributor

r? @alexcrichton

ENV TARGET=armebv7r-none-eabihf

ENV CC_armebv7r_none_eabihf=armeb-eabi-gcc \
CFLAGS_armebv7r_none_eabihf="-mthumb -march=armv7-r"
Copy link
Contributor

Choose a reason for hiding this comment

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

To match this rust target, you want -marm instead of -mthumb.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cortex-R has ARM+Thumb instruction (dual mode). Wake-up in ARM mode and can use Thumb instr. So here armv7-r select ARM mode, -mthumb extend support for Thumb.

The same logic also in LLVM: the triple armebv7r-none-eabihf and the feature +thumb2.
This is a working Makefile that use -mthumb -march=armv7-r and this a working JSON.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that's correct, it supports Arm and Thumb state. The question is what you want the default for this target to be? -mthumb and +thumb2 are not equivalent, +thumb2 does nothing because it's already Armv7. -mthumb is equivalent to using llvm_target thumbebv7r-none-eabihf or adding +thumb-mode to armebv7r-none-eabihf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh ok. Default shall be Arm. I'll move to -marm removing +thumb2 too.
I'll test again on target (TI TMS570LS3137) in the afternoon. Thanks.

@alexcrichton
Copy link
Member

To confirm, we've matched naming so far sort of with Debian but otherwise just tried to find preexisting conventions to name targets. In that sense, there's precedent for this name?

@paoloteti
Copy link
Contributor Author

armeb-linux-gnueabi is in the Debian list and
armebv7-eabihf--musl is a well know toolchain. Similar name is used by Linaro.

- remove +thumb2 that has not effect
- remove -mthumb

Tested on TMS570LS3137
@paoloteti
Copy link
Contributor Author

Updated with comments from @parched

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented May 20, 2018

📌 Commit 4897093 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2018
@bors
Copy link
Collaborator

bors commented May 20, 2018

⌛ Testing commit 4897093 with merge 522aa5e...

bors added a commit that referenced this pull request May 20, 2018
Add target for Big-endian ARM Cortex-R4F/R5F MCUs

The ARM Real-Time (‘R’) profile provides high-performing processors for safety-critical environments.

Cortex-R has ARM, Thumb instruction whereas Cortex-M makes use of Thumb only.

CI/Dockerfile is intentionally in the `disabled` folder.
@bors
Copy link
Collaborator

bors commented May 20, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 522aa5e to master...

@bors bors merged commit 4897093 into rust-lang:master May 20, 2018
@paoloteti paoloteti deleted the cortex-r branch May 21, 2018 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants