/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / STM32 USART2 Interrupt for receiving data

Username:     
Password:     
             

Forum

# 1   2012-04-23 07:05:36 STM32 USART2 Interrupt for receiving data

harinath
New member
Registered: 2012-04-21
Posts: 8
Website

STM32 USART2 Interrupt for receiving data

I have STM32 iNEMO Eval board from ST. I wrote some USART2 code for it. The transmission has no problems. But I'm receiving only first 2 bytes of data from PC even if i send 5 bytes.

void USART2_IRQHandler(void)
{
      if (USART_GetITStatus(USART2, USART_IT_RXNE) == SET)
      {
           USART_ClearFlag(USART2, USART_IT_RXNE);
           BT_buffer_rx[rxCount] = (uint8_t)USART_ReceiveData(USART2); // Read into buffer
           rxCount++;     // global uint8_t
       }
}

Any help appreciated.
Thanks
http://harinadha.wordpress.com/2012/04/17/stm32_usart2/

Last edited by harinath (2012-04-23 07:07:17)

Offline

 

# 2   2012-04-27 08:07:39 STM32 USART2 Interrupt for receiving data

harinath
New member
Registered: 2012-04-21
Posts: 8
Website

Re: STM32 USART2 Interrupt for receiving data

I have no problems in receiving now. But, i have only 1 problem in receiving while the device sending data. If i send a 3 bytes command to device , its not receiving.
What would be the problem ?

Offline

 

# 3   2012-05-03 09:06:06 STM32 USART2 Interrupt for receiving data

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

Re: STM32 USART2 Interrupt for receiving data

First you dont need to clear RXNE Flag because its cleared automatic if you read data register.

Offline

 

# 4   2012-05-04 05:08:57 STM32 USART2 Interrupt for receiving data

harinath
New member
Registered: 2012-04-21
Posts: 8
Website

Re: STM32 USART2 Interrupt for receiving data

You are right. I removed that line. I'm still having the problem i mentioned in this post.
I send some commands to Device from computer, They are received well. But if i send commands to Device when the device is transmitting data packets to computer, they are not received by Device USART, only first char is received.

I debugged several times. The problem still exists.

Last edited by harinath (2012-05-04 05:09:48)

Offline

 

# 5   2012-09-18 19:24:18 STM32 USART2 Interrupt for receiving data

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

Re: STM32 USART2 Interrupt for receiving data

sorry that im answering late did you solved it?

Last edited by primagen (2012-09-18 19:25:12)

Offline

 

# 6   2012-10-23 07:25:29 STM32 USART2 Interrupt for receiving data

harinath
New member
Registered: 2012-04-21
Posts: 8
Website

Re: STM32 USART2 Interrupt for receiving data

The problem solved long time ago, i could not be able to write the answer because of busy schedule. Anyway i solved it.
Thanks.

Offline

 

Board footer