2014-05-10 05:12 AM
Hello,
I am having a strange problem where my UART1 remap is getting dependent on I2C1 remap. Following is the scenario:/* Configure USART Tx as alternate function push-pull */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); /* Configure USART Rx as input floating */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_Init(GPIOB, &GPIO_InitStructure); //UART does not work without this remap!!! GPIO_PinRemapConfig(GPIO_Remap_I2C1, ENABLE);GPIO_PinRemapConfig(GPIO_Remap_USART1, ENABLE);
Please note that I have enabled the clocks for UART1, AFIO and PortB. I am unable to understand why I have to enable the remap for I2C1! I am not using I2C1 and also tried by disabling the peripheral clock for I2C1, but in vain. I appreciate any help regarding this issue. Thanks. Note: I am also remapping CAN1 to PB8/9 which are shared by I2C1 also. I am not sure if this is affecting. CAN1 is working fine with remap. #stm32 #alternate-remap2014-05-10 08:38 AM
You could review the errata, but my recollection of the F1 parts is there are a couple of conflicts which are resolved by parking the peripherals somewhere else via the remap. The CAN interferes with one of the USART CTS/RTS combinations.