2018-03-30 06:10 AM
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
2018-03-30 06:27 AM
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)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-
2018-03-30 08:36 AM
I did this. but, it is not working.
2018-03-30 09:56 AM
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.