2012-09-28 05:13 AM
Hi! I'm working with a STM32F0-Discovery board + IAR IDE
After loading this code... void USART_Configuration(void){ /* Abilita clock GPIOA e DMA */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA , ENABLE); /* Abilita clock USART2 APB */ RCC_APB2PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); /* configurazione pin USART2 **************************************************/ // GPIO_DeInit(GPIOA); /* Connette i pin PA14 e PA15 alla periferica USATR */ GPIO_PinAFConfig(GPIOA, GPIO_PinSource14, GPIO_AF_1); GPIO_PinAFConfig(GPIOA, GPIO_PinSource15, GPIO_AF_1); /* Configura i pin come AF pushpull */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_15 ; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_2; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_Init(GPIOA, &GPIO_InitStructure); /* Configurazione USART2: - BaudRate = 115200 baud - Word Length = 8 Bits - Stop Bit = 1 Stop Bit - Parity = No Parity - Hardware flow control disabled (RTS and CTS signals) - Receive and transmit enabled */ USART_DeInit(USART2); USART_InitStructure.USART_BaudRate = 115200; USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(USART2, &USART_InitStructure); USART_Cmd(USART2, ENABLE); }...
the board works wrong, because i can't program anymore the board.when i try a programming/bebugging session, i receive the seguent message''Fatal error: ST LINK, No MCU device found.''It' possible to restore the board? #usart2-/-boot-problem2012-09-28 11:09 AM
Because PA14 is SWCLK, part of the debug interface
Pull the BOOT0 pin high, and restart the device, it will go into the system loader instead of your code, then erase your code.2012-10-01 12:39 AM
2012-10-01 04:33 AM
RCC_APB2PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); //??
APB1 surely2012-10-01 04:57 AM
Great! Works, thank you clive1