-
Notifications
You must be signed in to change notification settings - Fork 973
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
NUCLEO-F429ZI SPI pin definitons wrong #1112
Comments
PA4 is either SPI1 NSS for alternate AF5 or SPI3 NSS for alternate AF6 However PD14 is not for SPIx (Table 12. STM32F427xx and STM32F429xx alternate function mapping of STM32F427xx STM32F429xx datasheet DocID024030 Rev 10) |
Thanks @FRASTM MOSI=7 or D11 --> pinName PA_7 is equal to 0x07 where GPIO port A (0x0) and GPIO pin 7 (0x7) --> pinNumber PA7 = 11 PIN assignments for SPI3 the SPI has been tested since a while and as mentioned by @FRASTM PD14 has no SPI capabilities. I guess to read the wrong datasheet. |
For information, there is a dedicated wiki page about this specific case on mbed-os. Hope this helps. |
"I guess to read the wrong datasheet" - I gave you the link to the datasheet I used. My reference to it which clearly shows your answer to be incorrect seems to have been removed - is there any reason for that? Anyway, here it is again, direct from the ST website: https://www.st.com/resource/en/user_manual/dm00244518-stm32-nucleo144-boards-stmicroelectronics.pdf And here is a screenshot (again) that proves your answer wrong "SPI has been tested since a while and as mentioned by @FRASTM PD14 has no SPI capabilities" How do you explain the above? Also how do you explain that when I use the values that you claim are correct, that neither SPI1 nor SPI3 work, but when I put in the correct figures from ST's own datasheet it works perfectly? So, yes - "I guess to read the wrong datasheet" - but it is you that is reading the wrong datasheet, not me! |
Nothing has been removed from your post... You can check by yourself: About the Nucleo datasheet, you are right, this is mentioned anyway looking to the MCU datasheet, there is no SPI CS: I will raise an issue internally to fix the Nucleo datasheet. The fact it works with PD14 doesn't means this is an HW CS just it is used as an SW CS. Please, note that the PeripheralPins.c is generated automatically thanks the MCU XML description file from STM32CubeMX, as you can see below there is no CS capabilities. Anyway those XML files can have an issue but is rare, in our case the Nucleo datasheet is not correct.
Our answers were correct and when I said it has been tested since a while this is correct. I never told a regression can occur anyway this is not the case.
Please keep calm 😉 I remember your comment on an issue when you told:
Honestly, I really don't know why this not work on your side... |
Well' fine. As the PeripheralsPins.c has been made to allow the user to customize it for their needs and that it works for you. There is no issue. It seems we cannot discuss and find what exactly is the issue. It works for you and me so no one is blocked. |
@philbowles I'll just share my 2 cents. First I think there is no need to get upset, I don't think that Frederic has provided any wrong information. There is a difference between SSEL and CS and it seems to me that this is the origin of the misunderstanding so far. The NUCLEO 144 board datasheet refers to SPI1_CS which is the Chip Select signal from board point of view. This CS can be implemented
The fact that PD14 is mapped to SPI1_CS does not tell us which of the above method is being used. To explain a bit further: the PeripheralPins.c contains the list of possible Alternate Function including the ones for SSEL (i.e. to be used when the Chip Select functionality is fully handled by the HW SPI peripheral including the SPI peripheral SSEL pin). This SSEL HW peripheral signal is not often used, most SPI applications use a GPIO for CS control. This list of available Alternate Functions are listed in the MCU datasheet, not the board datasheet. So the table canot be updated accoring to Board datasheet, it needs to reflect MCU datasheet. With that understanding in mind, as far as I see now:
Again we need the APP context to verify this. |
The difference between GPIO and Alternate Function becomes really important when they are inputs - in SPI slave mode. |
Official answer:
|
I'm interfacing an SPI SD reader, since the SDIO examples won't compile. The good news is that I have TWO connected successfully on SPI1 and SPI3. The bad news is that I was only able to do that after I realised that the SPI pin defnitions in
...Arduino15\packages\STM32\hardware\stm32\1.9.0\variants\NUCLEO_F429ZI\PeripheralPins.c
bear no resemblance whatsoever to the pin defintions given in the datasheet.
I provided my own replacements in the sketch, copying the values from the datasheet and everything works perfectly. Without them nothing works at all. Are they a "cut and paste" error from a different MCU ? How anyone has ever used hardware SPI on this board is beyond me.
With my defintions, the output is as follows:
and using those pins allows both SD cards to work on SPI1 and SPI3
Without my defintions i.e. using the wrong defaults from Peripherals.c, the output is:
PIN assignments for SPI1
Which are clearly wrong and result in neither SPI port functioning.
The text was updated successfully, but these errors were encountered: