Skip to content

stm32: cordic: merge per-call CSR writes into single register access#5663

Draft
okhsunrog wants to merge 1 commit intoembassy-rs:mainfrom
okhsunrog:cordic-optimize-csr
Draft

stm32: cordic: merge per-call CSR writes into single register access#5663
okhsunrog wants to merge 1 commit intoembassy-rs:mainfrom
okhsunrog:cordic-optimize-csr

Conversation

@okhsunrog
Copy link
Contributor

Each CORDIC calc function (blocking_calc_32bit, blocking_calc_16bit,
async_calc_32bit, async_calc_16bit) previously made 3 separate
read-modify-write cycles to configure the CSR register (NARGS, NRES,
ARGSIZE/RESSIZE). Since all CSR fields are known at call time, these
are consolidated into a single register write.

Changes

  • Replace per-field CSR helpers (set_func, set_precision, set_scale,
    set_argument_count, set_result_count, set_data_width) with a single
    write_csr() that writes all fields in one bus transaction
  • Consolidate reconfigure() from 8+ separate modify calls into 2 writes
  • Merge enable_write_dma/enable_read_dma into the write_csr call for
    async functions, and replace separate disable calls with disable_dma()
  • Consolidate extra_config() into a single modify

@okhsunrog okhsunrog force-pushed the cordic-optimize-csr branch from bc6ba13 to 813364b Compare March 13, 2026 22:02
@xoviat xoviat added this pull request to the merge queue Mar 13, 2026
@xoviat xoviat added the trusted label Mar 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 13, 2026
@okhsunrog okhsunrog force-pushed the cordic-optimize-csr branch 6 times, most recently from 9482a6a to f4fc85b Compare March 13, 2026 23:46
@okhsunrog
Copy link
Contributor Author

bender run

@embassy-ci
Copy link

embassy-ci bot commented Mar 13, 2026

run: permission denied

@okhsunrog okhsunrog force-pushed the cordic-optimize-csr branch 2 times, most recently from a546de2 to 5446687 Compare March 13, 2026 23:59
@xoviat
Copy link
Contributor

xoviat commented Mar 14, 2026

Ok to merge?

@okhsunrog okhsunrog force-pushed the cordic-optimize-csr branch from 5446687 to 120fcbb Compare March 14, 2026 00:06
@okhsunrog okhsunrog marked this pull request as draft March 14, 2026 00:09
@okhsunrog
Copy link
Contributor Author

@xoviat still debugging some issues, figuring out what exactly breaks HIL

@okhsunrog okhsunrog force-pushed the cordic-optimize-csr branch from 120fcbb to 83a4ecd Compare March 14, 2026 00:11
@okhsunrog okhsunrog force-pushed the cordic-optimize-csr branch from 83a4ecd to 3f364bc Compare March 14, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants