Skip to content

Conversation

@djbyrne17
Copy link
Collaborator

@djbyrne17 djbyrne17 commented Nov 19, 2025

Related Issue(s) #4140
Has Unit Tests (y/n) n
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) n

Change Description

  1. Add enum SpiStatus to include values for each error already noted in Events.fppi
  2. Convert Spi access port from "sync" to "guarded", consistent with I2C port. (In Drv/Interfaces/Spi.fpp)

Rationale

This would bring it in line with other similar drivers like I2C.

Testing/Review Recommendations

Unit Test is currently broken. Should be fixed to do one or several of:

  • At least not run all the other UTs, as reported in Issue #4405
  • Run on any supported platform, possibly just a subset of tests.
  • Run only on a linux development workstation.
  • Require specific hardware to run.

Future Work

Issue #4470 captures more work to go on this component, including

  1. Fix / create Unit Test
  2. Add docs/sdd.md
  3. Add SpiStatus to other existing function

AI Usage (see policy)

N/A

readBuffer);
}

SpiStatus LinuxSpiDriverComponentImpl::SpiWriteRead_handler(const FwIndexType portNum,

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@djbyrne17 djbyrne17 requested a review from thomas-bc November 19, 2025 21:53
@thomas-bc thomas-bc added the Breaking Changes / Needs Release Notes Need to add instructions in the release notes for updates. label Nov 19, 2025
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Let's address the TODOs and we should be good to go

@thomas-bc
Copy link
Collaborator

Ah also you will need to format your files. This can be done with this one-liner:

git diff --name-only devel...HEAD | fprime-util format --stdin

@djbyrne17 djbyrne17 marked this pull request as ready for review November 21, 2025 02:28
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I'd like a second set of eyes to run through the comment below.

cc @LeStarch

Fw::Buffer& readBuffer) {
FW_ASSERT(portNum >= 0, static_cast<FwAssertArgType>(portNum));
FW_ASSERT(writeBuffer.isValid());
FW_ASSERT(readBuffer.isValid());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be ok; but also Googling around seems to suggest there might be use cases for unidirectional SPI, so I wonder if we really should assert here? I'd like to get someone else's eyes on this to confirm, since we weren't asserting before.

@nasa nasa deleted a comment from Nvidia-Developer Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Changes / Needs Release Notes Need to add instructions in the release notes for updates.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants