AnsweredAssumed Answered

USART2 / BOOT problem

Question asked by serao.pietro on Sep 28, 2012
Latest reply on Oct 1, 2012 by serao.pietro
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?

Outcomes