Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Per #370/#235, the const fn ptr() was supposed to be deprecated and
subsequently removed. This PR removes it for the master branch tracking
the 0.8 release
|
|
381: TPIU: swo_supports: make struct fields public, improve documentation r=thejpster a=tmplt
A few small changes that I missed the first time around when the TPIU API was expanded.
Co-authored-by: Viktor Sonesten <v@tmplt.dev>
|
|
|
|
|
|
|
|
380: Improve singleton!() macro r=adamgreig a=Rahix
This PR addresses two shortcomings of the `cortex_m::singleton!()` macro, which I raised in #364. For review, I think it is best to look at the two commits implementing these changes individually.
I think this changeset should also be backported to `0.7.x` where it applies cleanly and which is also the place where I tested it.
### 1. Fix `singleton!()` sometimes ending up in `.data`
The static is always initialized to a "zero" value with `Option::None` which means it should end up in `.bss`. However, if the enclosed type has a niche, `Option::None` can become a non-zero bitpattern which moves the whole singleton from `.bss` to `.data`. This is especially problematic when storing large buffers in the `singleton!()` as this starts eating lots of flash space unnecessarily.
To prevent this, I switched to using an explicit boolean flag instead. This is not quite as nice but at least there is no chance for the `singleton!()` to end up in `.data`...
For reference and as an example, the faulty behavior can be triggered with
```rust
cortex_m::singleton!(: Option<u32> = None)
```
(the inner option has a non-zero niche which the outer option will occupy)
### 2. Allow naming the `static`
Due to the static always being named `VAR` right now, all `singleton!()` instances end up having non-descriptive symbol names like `__cortex_m_rt_main::{{closure}}::VAR` which makes them hard to tell apart in a debugger or when looking at an objdump.
I added the ability to set an explicit name which end up becoming part of the symbol name. This does not affect Rust code at all - the new name is not visible anywhere. It works like this:
```rust
let value = singleton!(FOO_BUFFER: [u8; 1024] = [0u8; 1024]);
```
Of course the old syntax also still works and keeps the old behavior of calling the static `VAR`.
Fixes #364.
Co-authored-by: Rahix <rahix@rahix.de>
|
|
|
|
As detailed in rust-embedded/cortex-m#364, niche optimization of the
`Option` used in the `singleton!()` macro can lead to the initial value
of the static to contain non-zero bits. This in turn leads to the whole
static being moved from `.bss` to `.data` which means it eats up flash
space for no reason. Especially if the singleton stores a particularly
large type, this can be quite problematic.
Prevent this by using an explicit boolean flag instead of the `Option`
type. This is not quite as nice but at least there is no chance for the
`singleton!()` to end up in `.data`...
|
|
Right now, the `singleton!()` macro always creates a static named `VAR`.
This is annoying when digging through objdump output or digging into
memory with a debugger because it is hard to see what singleton you're
looking at when they are all called `<...>::{{closure}}::VAR`.
To make it a bit nicer, allow setting the name of the generated static
to some meaningful identifier which can then be cross-referenced in
debugger output, for example with
singleton!(FOO_BUFFER: [u8; 1024] = [0u8; 1024]);
There is no other side-effects to this change - the identifier is never
visible to other code because it is still contained in the closure of
the macro.
|
|
379: Backport 0.7.4's changelog updates and version number to master r=thejpster a=adamgreig
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
378: CHANGELOG: add missing items r=adamgreig a=tmplt
Co-authored-by: Viktor Vilhelm Sonesten <v@tmplt.dev>
|
|
|
|
373: `SCB.ICSR.VECTACTIVE` is 9 bits, not 8 r=adamgreig a=TDHolmes
Closes #332
Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
|
|
|
|
|
|
Closes #332
|
|
366: itm: derive serde for `LocalTimestampOptions`, impl gated `TryFrom<u8>` r=adamgreig a=tmplt
This PR is an upstream push of more std-features required by `cargo-rtic-scope`. If required, the `TryFrom<u8>` impl can be kept downstream.
Co-authored-by: Viktor Sonesten <v@tmplt.dev>
|
|
350: Update bare-metal dependency r=adamgreig a=hellow554
Bare-metal has released its 1.0 version. Let's use it!
Co-authored-by: Marcel Hellwig <github@cookiesoft.de>
Co-authored-by: Marcel Hellwig <git@cookiesoft.de>
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
374: Construct a SysTick delay with a clock source r=adamgreig a=mciantyre
Helpful for users who prefer an external clock source for their system
timer. Proposing this as a 0.7 backwards-compatible change.
Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>
|
|
367: add methods needed for cycle count comparisons r=adamgreig a=TDHolmes
Extends the existing DWT comparator code to include cycle count comparisons which fire a `DebugMonitor` exception, if enabled with `enable_debug_monitor`. See working example [here](https://github.com/TDHolmes/embedded-profiling/blob/58d8b106921977816e2b5a05bcb43e976197edaf/ep-dwt/src/lib.rs#L57)
Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
|
|
369: Switch "native" check from being x86_64 only to checking `HOST` r=adamgreig a=TDHolmes
If `HOST==TARGET`, we know we're compiling natively. Set a new `rustc` cfg for this and use it where we previously checked for `x86_64`.
I was trying to run tests on my M1 MacBook Pro and couldn't since it isn't `x86_64`. Also, the currently configured nightly compiler for asm doesn't have M1 support, so I updated that. I'm fine reverting that change though, I can just do that locally, but I'm sure others will hit the same issue and it's a bit old...
Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
|
|
Helpful for users who prefer an external clock source for their system
timer. Proposing this as a 0.7 backwards-compatible change.
The constructor name tries to follow the "general constructors"
recommendation in the Rust API naming guidelines.
https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case
|
|
|
|
If `HOST==TARGET`, we know we're compiling natively. Set a new `rustc`
cfg for this and use it where we previously checked for `x86_64`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372: asm/inline: explicitly use asm macro r=adamgreig a=jordens
`asm!()` removed from prelude in current nightly
https://github.com/rust-lang/rust/pull/91728
close #371
This is also a good candidate for the cortex-m v0.7 series.
Co-authored-by: Robert Jördens <rj@quartiq.de>
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removed from prelude in current nightly
https://github.com/rust-lang/rust/pull/91728
close #371
Signed-off-by: Robert Jördens <rj@quartiq.de>
|
|
The alternative is to create another std-* gate for each std-related
functionality. I do not think this will scale well, and makes the crate
difficult to use.
If the end-user wants to use host-side functionality they will only need
to specify "std".
|
|
|