rust-embedded / rust-embedded/cortex-m

Cache maintenance operations require reference to self

Open
#304 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking change enhancement
Dominant language
Rust
Stars
1k
Forks
202
Avg merge
6d 2h
Merged PRs (30d)
2

Description

Various cache maintenance-related operations require a self reference, which means that it is not possible for a HAL or other peripherals to clean/invalidate and/or perform other cache related operations without owning the SCB.

In the context of DMA, this can be a stumbling block, as DCACHE needs to be cleaned and invalidated before and after transfers (if it is enabled).

Is it possible to refactor the cache maintenance functions to not require a self reference so that they can be called statically as cortex_m::peripherals::scb::invalidate_dcache_by_address()?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the SCB cache-maintenance functions, especially invalidate_dcache_by_address, and inspect why they require an SCB instance. Check the existing cache APIs and their tests or call sites; done means the relevant operations can be called without owning SCB while retaining their current behavior, including DMA use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.