2022-04-14 05:47 AM
Solved! Go to Solution.
2022-04-14 06:53 AM
If the pin is in SPI mode, trying to toggle it will not affect SPI communication. But if it's initialized as GPIO last, then clearly SPI mode won't work.
Unclear what "code written earlier" means exactly. Surely you can edit code to do what you want instead of what it did before. The order in which code is executed is going to affect things.
2022-04-14 05:54 AM
GPIO->ODR or BSRR ain't going to work if that's their question. The AF mux will determine who owns control
2022-04-14 06:09 AM
If a pin is in AF mode, the peripheral controls the pin state (input vs output) as well as its output state. ODR/BSRR is ignored in this case.
2022-04-14 06:11 AM
Thank You for response. I have activated SPI1 in f401re(nucleo board), but in code written earlier SCK was common GPIO, connected with LED, and this part of code wasn't commented. May it affect SPI functionality?
2022-04-14 06:16 AM
Thank You for answers.
2022-04-14 06:53 AM
If the pin is in SPI mode, trying to toggle it will not affect SPI communication. But if it's initialized as GPIO last, then clearly SPI mode won't work.
Unclear what "code written earlier" means exactly. Surely you can edit code to do what you want instead of what it did before. The order in which code is executed is going to affect things.
2022-04-14 06:54 AM
If your code control LED ODR/BSRR no , but if you activate other AF as PWM then SPI AF will ovrride...
2022-04-17 09:54 PM
Thank You!