You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 7, 2022. It is now read-only.
First of all, I am completely new to embedded development and relatively new to Rust, but I have an ARMv7 board with the Allwinner A20 (Olimex A20 OLinuXinoLime2 to be precise) laying around that I would like to experiment and learn embedded Rust with.
I saw that the PR for the Cortex A working group only mentioned aarch64 while the A20 uses Cortex A7 cores which would be the armv7 target.
Is there any work happening/done for supporting bare metal armv7 yet? Is this something that I should even attempt to work on as someone new to embedded?
This crate is a support crate (library). It currently only supports aarch64 cortex-a processors, and due to limited bandwidth on my side, no plans to add aarch32 support for now. Having such a support crate is only one part of the equation, though.
To actually compile for aarch32 bare-metal, you would first need to have a suitable target for cargo xbuild to use (--target). For aarch64, those are:
I faintly remember that one of the few differences is that the R profile doesn't have VMSA support?
Don't know if the llvm backend accounts for that, though.
So depending on if you're going to use that or not it might work.
Hi.
v8-R implements the AArch32 execution state. Also the A32 and T32
instruction sets. So it is similar to v8-A in that respect which is why at
the Application level, toolchains targeting v8-A may be used for v8-R.
At the system level things are somewhat different: v8-R only supports PMSA
and introduces an optional EL2 (Hyp mode).
From the PoV of the Cortex-A crate, I _think_ (needs verification) that the
architectural system control register accessors should be common to both
profiles.
My suggestion would be to consider creating a WiP branch of the Cortex-A
crate focused on exploring any modifications specific to v8-R. That way we
can reason about the differences and consider whether it makes sense to
continue with some conditional glue or consider another route.
Robin
On Tue, Dec 10, 2019 at 2:25 PM Andre Richter ***@***.***> wrote:
I faintly remember that one of the few differences is that the R profile
doesn't have VMSA support?
So depending on if you're going to use that or not it might work.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11?email_source=notifications&email_token=AAFMKYWRYU2OHAO2XBJHGVDQX6RHBA5CNFSM4JVF6MK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGPNB4Q#issuecomment-564056306>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFMKYXWFCYI5PAFCYU3UNTQX6RHBANCNFSM4JVF6MKQ>
.
There is already a toolchain available for ARMv7: "armv7r_none_eabi.rs".
According to the name it is for ARMv7 Cortex-R cores, but afaik there is no difference in the toolchain compared to a toolchain for an ARMv7 Cortex-A.
So toolchain support is already there.
As for this issues, maybe it would help to clarify in the readme which "Cortex-A" CPU's are supported by this repo in the readme? "Cortex-A" can refer to both ARMv8 and ARMv7 CPU's.
As for this issues, maybe it would help to clarify in the readme which "Cortex-A" CPU's are supported by this repo in the readme? "Cortex-A" can refer to both ARMv8 and ARMv7 CPU's.
Hey, sorry for my inactivity, have been very busy :)
Thank you all for your input, I will try the things you suggested and see how far I get. If I get something to work, I will definitely let you know.
Shameless ad: I am writing stuff for the beaglebone, which is a 32bit Cortex-A SoC (armv7). If someone is interested in this, I can make the repos public, but the code is very experimental and I am not an comp-sci expert.
@andre-richter that is cool. I thought about making a pull request, but was not sure whether people are interested in that. @UniqueActivehttps://github.com/mcdoll/armv7 here is the low-level armv7 stuff. The memory management unit needs some asm at startup, otherwise nothing will work and my way to use the interrupts is quite sketchy, but does not need asm. I add another repo with a simple reference implementation for the beagle later and link to it in the armv7 repo.
Activity
andre-richter commentedon Dec 5, 2019
This crate is a support crate (library). It currently only supports aarch64 cortex-a processors, and due to limited bandwidth on my side, no plans to add aarch32 support for now. Having such a support crate is only one part of the equation, though.
To actually compile for aarch32 bare-metal, you would first need to have a suitable target for cargo xbuild to use (
--target). For aarch64, those are:There is no bare-metal target for armv7 yet. There was an attempt (rust-lang/rust#60135), but it didn't make it upstream. However, for starters, you could use the targets in the PR to generate a custom target
.jsonand use that (Example here: https://os.phil-opp.com/minimal-rust-kernel/#putting-it-together).RobertBuhren commentedon Dec 10, 2019
There is: https://github.com/rust-lang/rust/blob/master/src/librustc_target/spec/armv7r_none_eabi.rs
andre-richter commentedon Dec 10, 2019
This would be a Cortex-R target.
RobertBuhren commentedon Dec 10, 2019
IMHO there is not difference to Cortex-A regarding the toolchain. Both architectures are defined by the ARMv7-AR reference manual.
andre-richter commentedon Dec 10, 2019
I faintly remember that one of the few differences is that the R profile doesn't have VMSA support?
Don't know if the llvm backend accounts for that, though.
So depending on if you're going to use that or not it might work.
RobertBuhren commentedon Dec 10, 2019
Correct, it uses PMSA. But that shouldn't be relevant for the toolchain?
raw-bin commentedon Dec 10, 2019
andre-richter commentedon Dec 18, 2019
In summary, there's two things you need for bare-metal Cortex A7.
--targetjson way from my first comment.cortex-ato wrap the unsafe code.aarch64.aarch32support is not on the roadmap, but we would accept PRs.Hope that helps. I would close this issue if all your questions are answered. Is there anything open?
Thanks,
Andre
RobertBuhren commentedon Dec 19, 2019
There is already a toolchain available for ARMv7: "armv7r_none_eabi.rs".
According to the name it is for ARMv7 Cortex-R cores, but afaik there is no difference in the toolchain compared to a toolchain for an ARMv7 Cortex-A.
So toolchain support is already there.
As for this issues, maybe it would help to clarify in the readme which "Cortex-A" CPU's are supported by this repo in the readme? "Cortex-A" can refer to both ARMv8 and ARMv7 CPU's.
Regards,
Robert
andre-richter commentedon Dec 19, 2019
Good point. I pushed 9ec8dd7
UniqueActive commentedon Dec 19, 2019
andre-richter commentedon Dec 20, 2019
Thanks! Closing for now.
mcdoll commentedon Jan 18, 2020
Shameless ad: I am writing stuff for the beaglebone, which is a 32bit Cortex-A SoC (armv7). If someone is interested in this, I can make the repos public, but the code is very experimental and I am not an comp-sci expert.
UniqueActive commentedon Jan 18, 2020
andre-richter commentedon Jan 18, 2020
On that topic, said bare metal targets are upstream soon rust-lang/rust#68253
mcdoll commentedon Jan 18, 2020
@andre-richter that is cool. I thought about making a pull request, but was not sure whether people are interested in that.
@UniqueActive https://github.com/mcdoll/armv7 here is the low-level armv7 stuff. The memory management unit needs some asm at startup, otherwise nothing will work and my way to use the interrupts is quite sketchy, but does not need asm. I add another repo with a simple reference implementation for the beagle later and link to it in the armv7 repo.