-
Notifications
You must be signed in to change notification settings - Fork 3k
Using SPI_ macros from PinNames in SPIF and SD config files. #7979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Why SPI_PERSISTENT_MEM_CS and not SPI_CS ? |
Because SPI_CS can point not only to storage but to any device/subdevice connected to the SPI bus. |
@@ -60,12 +60,6 @@ | |||
"SPI_CLK": "PTD5", | |||
"SPI_CS": "PTD4" | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all NUCLEO and DISCO target_overrides configuration
as SPI_xxx define should be already defined for them.
Thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASFAIK, not all NUCLEO and DISCO has those pins defined. Also, some of them were defined by the data from spif and some from sd. So in case, spif is the original definition we left the sd target override as it was.
"SPI_CS": "SPI_PERSISTENT_MEM_CS", | ||
"SPI_MOSI": "SPI_MOSI", | ||
"SPI_MISO": "SPI_MISO", | ||
"SPI_CLK": "SPI_SCK", | ||
"DEVICE_SPI": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that MBED_CONF_SD_DEVICE_SPI is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean MBED_CONF_SD_SPI
So default setting should be And this should be overridden only the the targets that have some connected SPI memory.
|
No, we prefer that the configuration for the storage will be always SPI_PERSISTENT_MEM_CS. if someone like in the PinNames.h he can do |
There have been changes in #7774 that do not look good to me at first glance - but maybe I'm wrong .. So my point is: adding SPI_PERSISTENT_MEM_CS in pinnames.h on D10 of for example the L475 IOT discovery board does not make sense to me: D10 pin is just a GPIO and this definition of SPI_PERSISTENT_MEM_CSapplies I guess in case the CI test shield is plugged in, but D10. There is one persistent memory on this target and this is the embdded QSPI. So we think that the SPI_PERSISTENT_MEM_CS definition definitely does not belong to here. One more question: how have you selected the list of targets that were updated in #7774 ? thanks in advance |
@yossi2le @dannybenor Sounds good. Just need to find out the right place where SPI_PERSISTENT_MEM_CS definition belongs to. |
3e1c9b5
to
7fa4adf
Compare
PR #7995 should revert this changes. |
Any update ? |
@yossi2le The revert was integrated, this PR is now ready as it is ? If yes, someone from @ARMmbed/mbed-os-storage should review |
Why don't you use as default configuration Arduino pin ? |
Because we aiming that SPI_ macros in PinsNames.h will be the defaults, while we keep the option to allow changes by configuration. |
@yossi2le Can we proceed ? Rebase to resolve latest updates, and @ARMmbed/mbed-os-storage team to review |
7fa4adf
to
77eb74e
Compare
Rebase done. |
Still waiting for @ARMmbed/mbed-os-storage to review. @ARMmbed/mbed-os-maintainers When y'all get a chance, the unittests also need to be rerun. Results are not due to PR, but due to glitch from last week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me
@jeromecoutant @LMESTM All questions answered here, good to progress? |
No... I don't like the default use of SPI_PERSISTENT_MEM_CS... "target_overrides": { |
@jeromecoutant. "NUCLEO_L031K6": { Besides if we don't have this you still need to configure every board because the global configuration now is set to NC by mistake. Second, we think that SPI_CS cannot be set always to point on storage. if you have more component connected to the SPI bus they all need a different cheap select. Therefore, we like to have one specific pin name for the storage. |
Just to stir the pot - yes, SPI_CS is obviously device-specific, but then so are the others, really. You can have multiple SPI buses, so there's an implied "bus for the storage" for SPI_MOSI, SPI_MISO and SPI_CLK too... I don't think it's the end of the world if the legacy "SPI_xxx" meaning "SPI pins for storage" in PinNames.h is retained. It doesn't preclude more specific names for other devices and drivers. But having some prefixed, some not seems odd. |
77eb74e
to
d9a84c4
Compare
I have replaced the SPI_PERSISTENT_MEM_CS macro with SPI_CS and rebased. |
Thank you all for quick resolution here! /morph build |
Build : SUCCESSBuild number : 3462 Triggering tests/morph test |
Test : FAILUREBuild number : 3253 |
/morph test |
Exporter Build : SUCCESSBuild number : 3085 |
Test : SUCCESSBuild number : 3259 |
This is sitting on top of #7955 scheduled for 5.11 |
Description
Now after PR #7774 merged the following pins add been added to mbed-os:
SPI_MOSI
SPI_MISO
SPI_SCK
SPI_PERSISTENT_MEM_CS
This PR is created in order to start using them in the new components block devices configuration file.
Pull request type