Showing results for 
Search instead for 
Did you mean: 

PB6 not working when debugging


I am using PB6 as a GPIO input with a pull-up for monitoring a switch to ground.  It works properly when not debugging but has some kind of signal on it when debugging that prevents proper operation.  Note: I am using the STLINK-V3SET debugger.

Is there a way that I can disable whatever is causing this?



Accepted Solutions

Check pin configuration and involvement with UCPD and pull down. Check Data Sheet. No specific involvement with debugger unless it changes RCC or GPIO registers.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you Tesla, 

I'm not sure what you mean.  I am using USB in the project; could it be related to this?  I notice that one of the PB6 pin options is the USART1_TX pin.  I see in a design from ST that that signal (from PA9) is connected to the 14-pin JTAG connector pin 14.  Is it possible that the STM32G474RB3 uses this pin while debugging? 

Tesla meant this.


Thanks again waclawek.jan.  I'll do some more research.

I was able to solve the PB6 issue by forcing PA9 and PA10 to be initialized as low outputs or by setting the UCPD1_DBDIS bit in the PWR_CR3 register.  The explanation is in footnote 6 of pin definition table (Table 12) in the STM32G474xB datasheet (page 72).  I appreciate all of your help and that of the other contributors on this forum.