aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-02-24Remove outlined asm, replace with stable inline asm.Gravatar Adam Greig 54-1005/+301
2022-02-24Allow #[naked] attribute on interrupt handlers and pre_initGravatar Adam Greig 1-0/+1
2022-02-24Exclude c-m-rt from cron test of cortex-m, fixes #417Gravatar Adam Greig 1-1/+1
2022-02-15add itns field to NVIC perphGravatar Sascha Wise 1-1/+8
2022-02-07Merge #421Gravatar bors[bot] 1-0/+1
421: Allow #[naked] attribute on interrupt handlers and pre_init r=thalesfragoso a=adamgreig Might be useful for `pre_init` especially, now that constrained naked functions are hopefully [on the road to being stable](https://github.com/rust-lang/rust/issues/90957). `pre_init` and `entry` are called from our `asm.S` via `bl __pre_init` and `bl main`, exception and interrupt handlers are called directly by the CPU; in either case there's no issue with calling a naked function. Inspired by https://twitter.com/the6p4c/status/1489266955232034817 Co-authored-by: Adam Greig <adam@adamgreig.com>
2022-02-03Allow #[naked] attribute on interrupt handlers and pre_initGravatar Adam Greig 1-0/+1
2022-02-02Merge #418Gravatar bors[bot] 1-1/+1
418: Exclude c-m-rt from cron test of cortex-m, fixes #417 r=thejpster a=adamgreig Excludes cortex-m-rt from the plain ci-linux cron CI. We already test cortex-m-rt separate in rt-ci-linux, and plain `cargo test` doesn't work on x86 for cortex-m-rt. Fixes #417 which is where this week's cron run failed. Co-authored-by: Adam Greig <adam@adamgreig.com>
2022-01-29Exclude c-m-rt from cron test of cortex-m, fixes #417Gravatar Adam Greig 1-1/+1
2022-01-27Merge #416Gravatar bors[bot] 3-2/+14
416: Fix #414, use fully qualified path for `exception` enum in `#[exception]` macro r=thalesfragoso a=adamgreig Partially reverts https://github.com/rust-embedded/cortex-m-rt/pull/224 to continue to use a fully-qualified path to `exception`. Co-authored-by: Adam Greig <adam@adamgreig.com>
2022-01-26c-m-rt: fix macro hygiene, set to edition 2018Gravatar Adam Greig 2-2/+3
2022-01-26Fix #414Gravatar Adam Greig 2-1/+12
Partially reverts https://github.com/rust-embedded/cortex-m-rt/pull/224 to continue to use a fully-qualified path to `exception`.
2022-01-23Merge #415Gravatar bors[bot] 10-23/+17
415: Fix most clippy lints r=adamgreig a=newAM This fixes all clippy lints that do not result in a user-visible change, and result in valid code for the 1.40 MSRV. Co-authored-by: Alex Martens <alex@thinglab.org>
2022-01-23Bump MSRV from 1.40 to 1.42, fix clippy::match_like_matches_macroGravatar Alex Martens 8-16/+10
2022-01-23Fix most clippy lintsGravatar Alex Martens 3-7/+7
2022-01-23Merge #391c-m-rt-v0.7.1Gravatar bors[bot] 96-6/+4971
391: Merge cortex-m-rt into this repository r=thejpster a=adamgreig This PR merges the cortex-m-rt repository (with history) into this repo, inside the `cortex-m-rt` folder which is added to the workspace. The main advantage is easier combined testing of cortex-m with cortex-m-rt (including on-hardware tests e.g. #355), and in the future easier changes across the two projects. The MSRV of cortex-m-rt is bumped 1.39 -> 1.40 to align it with cortex-m itself. I've updated the CI to run the same tests and checks as before, and updated references to the old URL. If/after this is merged, I propose adding a note to the old repo's README and then archiving it. An alternative to this technique would be adding all the files in one new commit (not preserving history), if anyone thinks that would be neater. NB: This PR also adds an inline to ITM to fix a clippy hard error. For future reference, the git work was: ``` cd cortex-m-rt git filter-repo --to-subdirectory-filter cortex-m-rt cd ../cortex-m git remote add rt ../cortex-m-rt git fetch rt git merge --allow-unrelated-histories rt/master ``` Co-authored-by: bors[bot] <bors[bot]@users.noreply.github.com> Co-authored-by: Jonathan 'theJPster' Pallant <github@thejpster.org.uk> Co-authored-by: Adam Greig <adam@adamgreig.com> Co-authored-by: Jonas Schievink <jonasschievink@gmail.com> Co-authored-by: Jorge Aparicio <jorge@japaric.io> Co-authored-by: Emil Fresk <emil.fresk@gmail.com> Co-authored-by: Daniel Egger <daniel@eggers-club.de> Co-authored-by: Niklas Claesson <nicke.claesson@gmail.com> Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Vadim Kaushan <admin@disasm.info>
2022-01-22Add cortex-m-rt tests to scheduled CI runsGravatar Adam Greig 1-0/+45
2022-01-21Fix cortex-m-semihosting inline-asm on nightlyGravatar Adam Greig 1-3/+7
2022-01-21Fix break in compilefail tests on 1.58Gravatar Adam Greig 1-2/+4
2022-01-12Move device.x example to workspace root for cortex-m-rt tests.Gravatar Adam Greig 2-5/+5
2022-01-12Fix cortex-m-rt build that was depending on old cortex-m via out-of-tree ↵Gravatar Adam Greig 1-1/+1
cortex-m-semihosting
2022-01-12Fix cortex-m-rt compiletest testsGravatar Adam Greig 3-7/+4
2022-01-12Move examples' memory.x to workspace rootGravatar Adam Greig 1-0/+0
2022-01-12Bump cortex-m-rt MSRV 1.39->1.40 to support non_exhaustive in cortex-mGravatar Adam Greig 4-4/+4
2022-01-12Fix combined CIGravatar Adam Greig 2-3/+7
2022-01-12Update GHA for integrated cortex-m-rtGravatar Adam Greig 13-63/+20
2022-01-12Merge cortex-m-rt repository into cortex-m.Gravatar Adam Greig 94-0/+4956
2022-01-10Merge #385Gravatar bors[bot] 13-144/+62
385: remove the ptr() function in favor of the PTR constant r=adamgreig a=TDHolmes 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 Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
2022-01-06update changelog for panic-itm tooGravatar Tyler Holmes 1-0/+5
2022-01-06remove the ptr() function in favor of the PTR constantGravatar Tyler Holmes 12-144/+57
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
2022-01-06Merge #381Gravatar bors[bot] 2-5/+7
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>
2022-01-06TPIU: improve SWOSupports documentationGravatar Viktor Sonesten 1-1/+2
2022-01-06CHANGELOG: document TPIU::swo_supportsGravatar Viktor Sonesten 1-0/+1
2022-01-05tpiu: make SWOSupports fields publicGravatar Viktor Sonesten 1-4/+4
2022-01-04Merge #380Gravatar bors[bot] 2-10/+26
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>
2022-01-04Update CHANGELOGGravatar Rahix 1-0/+4
2022-01-04macros: Don't use Option in singleton!()Gravatar Rahix 1-8/+9
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`...
2022-01-03macros: Allow setting a name for singleton!() staticsGravatar Rahix 1-6/+17
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.
2022-01-03Merge #379Gravatar bors[bot] 2-10/+26
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>
2022-01-02Backport 0.7.4's changelog updates and version number to masterGravatar Adam Greig 2-10/+26
2022-01-02Merge #378Gravatar bors[bot] 1-1/+4
378: CHANGELOG: add missing items r=adamgreig a=tmplt Co-authored-by: Viktor Vilhelm Sonesten <v@tmplt.dev>
2022-01-02CHANGELOG: add missing itemsGravatar Viktor Vilhelm Sonesten 1-1/+4
2021-12-31Merge #373Gravatar bors[bot] 2-7/+12
373: `SCB.ICSR.VECTACTIVE` is 9 bits, not 8 r=adamgreig a=TDHolmes Closes #332 Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
2021-12-31clippy cleanupGravatar Tyler Holmes 1-1/+1
2021-12-31changelog entryGravatar Tyler Holmes 1-0/+4
2021-12-31`SCB.ICSR.VECTACTIVE` is 9 bits, not 8Gravatar Tyler Holmes 1-7/+8
Closes #332
2021-12-31Merge #366Gravatar bors[bot] 5-5/+44
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>
2021-12-31Merge #350Gravatar bors[bot] 2-11/+2
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>
2021-12-31Merge branch 'master' into patch-1Gravatar Adam Greig 39-114/+854
2021-12-29Merge #374Gravatar bors[bot] 2-8/+16
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>
2021-12-29Merge #367Gravatar bors[bot] 2-23/+111
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>