2016-11-15 01:44 AM
2016-11-15 02:35 AM
Here is my server data view, first data from ''GNRMC'' to ''4D'' comes from gps module and ''3'' is a single data which comes from stm32f030 , But it should be ''3567''
2016-11-15 10:31 PM
Hi there,
I have noticed something simmilar on STM32F030 just yesterday. I made a test program just to send 3 bytes in halfduplex mode using DMA. The bytes were 1,2,3. On the receiver side I only obtained 01 00 00. And those two zeros, I am not sure, but I dont think thats actually any data sent but some line mismatch... Please let me know if you solve your problem.2016-11-22 10:54 PM
Hi Bremen,
As I mentioned above, My assumption was considering stm32f0(Transmitter side via rs485) is ;Did not send or missing the relevant data.But I was getting response using 3 cable converter from putty. Therefore ,I focused to the receiver one(stm32f103) and I also used 3 cable converter for analyzing data flow in this part.Fortunately, I have verified that the data is correctly transmitted to this microcontroller.Then I focused to the reciever interrupt handler for usart1.The problem was, I reset buffer when each character is set to the char array.Thus it was getting only one character each time and only one character was indicating on server after resetting buffer. So, I used reset function of buffer in Interrupt handler as like this;void USART1_IRQHandler(void)
{
if (USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)//Data available in the Read Register.
//if(USART1->SR & USART_SR_RXNE)
{
// GPIO_SetBits(GPIOB,GPIO_Pin_0);
//GPIO_WriteBit(GPIOB,GPIO_Pin_0, Bit_RESET);
char ch = rs485data.serialPort.getch();
// if(ch!=50){
if(ch!=10){
if(ch!=13){
rs485data.serialPort.rxTrailerbuffer[rs485data.serialPort.rxTrailerbufferReadCounter++]=ch;
}}
// }
if(rs485data.rs485detect== false){
for (int i = 0;i<
rs485data.serialPort.rxTrailerbufferReadCounter
;i++){
TrailerData[i]=rs485data.serialPort.rxTrailerbuffer[i];
rs485data.serialPort.rxTrailerbuffer[i]=0;
}
TrailerData[rs485data.serialPort.rxTrailerbufferReadCounter]=0;
rs485data.rs485detect
=
true
;
rs485data.serialPort.rxTrailerbufferReadCounter
=
0
; //THIS ONE
//
// if(rs485data.serialPort.rxTrailerbufferReadCounter>6){
// rs485data.serialPort.rxTrailerbufferReadCounter=0;}
}
//char ch = sp1.getch();
USART_ClearITPendingBit(USART1, USART_IT_RXNE);
}
}
}