/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / USART2 makes trouble

Username:     
Password:     
             

Forum

# 1   2011-09-12 16:06:04 USART2 makes trouble

primagen
Member
Registered: 2010-12-07
Posts: 13

USART2 makes trouble

Hi,
i own an stm32f103 Board. USART1 is configured as TX via DMA and RX Polling.
I tried to configure the USART2 port TX polling and RX polling.
Confusing thing is that after sending on char to console the board resets in loop and the Console of USART2 prints after each reset a square symbol.
Configuration of USART2:

Code:

      
RCC->APB2ENR |= (RCC_APB2ENR_IOPAEN | RCC_APB2ENR_AFIOEN);
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
GPIO_CONF_OUTPUT_PORT(A,2,ALT_PUSH_PULL,50);
GPIO_CONF_INPUT_PU_PD(A,GPIO_CM3);
GPIOA->BSRR = GPIO_BSRR_BS3;
USART2->CR1 = USART_CR1_UE; //Enable USART ((u16)0x2000)
USART2->CR2 = 0; //Stopbits
USART2->CR1 |= USART_CR1_TE; // Transmitter Enable ((u16)0x0008)
USART2->BRR= 0x45; //Baudrate 115200
USART2->CR1 |= USART_CR1_RE;
USART2->CR1 |= USART_CR1_RXNEIE;
NVIC_SET_PRIORITY(USART2_IRQChannel, 2);
NVIC_ENABLE_INT(USART2_IRQChannel);.

send routine:

Code:

                
int u2_putchar(int c)
{
while (!(USART2->SR & USART_SR_TXE));
USART2->DR = (c & 0xFF);
return(c);
}

and in main i call u2_putchar(4); Without this call evrything works.

Last edited by primagen (2011-09-12 16:07:39)

Offline

 

# 2   2011-09-19 19:11:51 USART2 makes trouble

primagen
Member
Registered: 2010-12-07
Posts: 13

Re: USART2 makes trouble

No one an Idea?

Offline

 

# 3   2012-04-13 11:01:00 USART2 makes trouble

primagen
Member
Registered: 2010-12-07
Posts: 13

Re: USART2 makes trouble

Problem solved. After Debuuger shows me that the rx interrupt handler is invoked in loop i checked soldering of pins and see that rx pin is contact jtag line.
How can i close this post?

Offline

 

Board footer