Skip to main content
Shinya
Associate
August 17, 2022
Question

PB7 doesn't work as GPIO output when using SPI1 at NUCLEO-F303K8.

  • August 17, 2022
  • 2 replies
  • 1337 views

I set PB7 for the output pin to light a LED when PB7 is HIGH. However, after the function "HAL_SPI_Receive_IT()." is called, my LED doesn't light or turns off even if setting PB7 as output HIGH.

I use CubeMX ver. 6.6.1-RC2 and CubeIDE ver. 1.10.1.

Do you have any ideas about this problem and the solution?

This topic has been closed for replies.

2 replies

S.Ma
Principal
August 17, 2022

You probably have a dual use pin. Check board schematics interconnect. Use debugger and break/stop the code once malfunctionning. View the gpio hw registers MODE, if your pin is anything else than 01, else if the OUT reigster is wrong output level, then keep digging to find the root cause.

Shinya
ShinyaAuthor
Associate
August 17, 2022

Thanks to your reply, I found PB7 and SPI1_SCK connected by default on the Nucleo-F303K8 board. I will try to unsolder the connecting jumper resistor.