cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 PB13 pin

kadir ustun1
Senior
Posted on March 30, 2018 at 15:10

Hello, I will canbus protocol with CAN2. but, I dont use PB13 pin. I think this pin is used as vbus pin. How can ı change this pin as CAN2_TX

3 REPLIES 3
Nesrine M_O
Lead II
Posted on March 30, 2018 at 15:27

Hi

When VBUS sensing feature is enabled, PA9 and PB13 should be left at their default state (floating input), not as alternate function.Otherwise (

VBUS sensing not activated)

you can enable alternate function ( AF9 in your case) 0690X0000060AL8QAM.png

Hal configuration example:

GPIO_InitTypeDef GPIO_InitStruct; /*##-1- Enable peripherals and GPIO Clocks #################################*/ /* CAN1 Periph clock enable */__HAL_RCC_CAN2_CLK_ENABLE() /* Enable GPIO clock ****************************************/__HAL_RCC_GPIOB_CLK_ENABLE()(); /*##-2- Configure peripheral GPIO ##########################################*/ /* CAN1 TX GPIO pin configuration */ GPIO_InitStruct.Pin = GPIO_PIN_13; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Alternate = GPIO_AF9_CAN2; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

...

-Nesrine-

Posted on March 30, 2018 at 15:36

I did this. but, it is not working. 

Posted on March 30, 2018 at 16:56

Can we try to keep discussion about materially the same topic in a single thread?

https://community.st.com/0D50X00009XkWXmSAN

https://community.st.com/0D50X00009XkWXuSAN

https://community.st.com/0D50X00009XkWXsSAN

Don't refer to the STM32F429 when you mean a specific board implementation, ie STM32F429I-DISCO, where pin usage is defined by the designer of that board rather than the chip itself.

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