Skip to content

fix(PeriphDrivers): Corrected SPI driver on RV32 cores#1536

Merged
petejohanson-adi merged 1 commit intoanalogdevicesinc:mainfrom
petejohanson-adi:spi-rv32-fixes
Mar 24, 2026
Merged

fix(PeriphDrivers): Corrected SPI driver on RV32 cores#1536
petejohanson-adi merged 1 commit intoanalogdevicesinc:mainfrom
petejohanson-adi:spi-rv32-fixes

Conversation

@petejohanson-adi
Copy link
Copy Markdown
Collaborator

Description

Two fixes for using the SPI driver on the RV32 cores found on MAX32690, MAX32655, MAX78000/2:

  • Avoid use of memcpy to write/read volatile registers, favoring direct memory access to avoid platform differences. memcpy is discouraged for volatile access, for this very reason.
  • Move lock API calls into conditional to avoid their use on RV32.

This has been tested integrated into Zephyr, and fixes test failures there with some data sizes:

Device testing on:

| Platform                    | ID   | Serial device                  |
|-----------------------------|------|--------------------------------|
| max32690evkit/max32690/rv32 |      | /dev/tty.usbmodem0001760024391 |

INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - Total complete:    9/   9  100%  built (not run):    0, filtered:   63, failed:    0, error:    0
INFO    - 65 test scenarios (65 configurations) selected, 63 configurations filtered (56 by static filter, 7 at runtime).
INFO    - 2 of 2 executed test configurations passed (100.00%), 0 built (not run), 0 failed, 0 errored, with no warnings in 38.47 seconds.
INFO    - 27 of 27 executed test cases passed (100.00%) on 1 out of total 1469 platforms (0.07%).
INFO    - 3 selected test cases not executed: 3 skipped.
INFO    - 2 test configurations executed on platforms, 0 test configurations were only built.

Hardware distribution summary:

| Board                       | ID   |   Counter |   Failures |
|-----------------------------|------|-----------|------------|
| max32690evkit/max32690/rv32 |      |         2 |          0 |
INFO    - Saving reports...
INFO    - Writing JSON report /Users/petejohanson/source/upstream-zephyr-workspace/zephyr/twister-out/twister.json
INFO    - Writing xunit report /Users/petejohanson/source/upstream-zephyr-workspace/zephyr/twister-out/twister.xml...
INFO    - Writing xunit report /Users/petejohanson/source/upstream-zephyr-workspace/zephyr/twister-out/twister_report.xml...
INFO    - Run completed

(which requires a couple Zephyr fixes as well I'll be submitting there)

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

Two fixes for using the SPI driver on the RV32 cores found on MAX32690,
MAX32655, MAX78000/2:

* Avoid use of memcpy to write/read volatile registers, favoring direct
  memory access to avoid platform differences. memcpy is discouraged for
  volatile access, for this very reason.
* Move lock API calls into conditional to avoid their use on RV32.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
@petejohanson-adi petejohanson-adi merged commit 4762c53 into analogdevicesinc:main Mar 24, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants