Question
Problem in sending continuous stream of data in UART
Hi,
Please find the piece of code, where i'm transmitting a buffer of 255 bytes of data.
int main(void) {
uint8_t read[255];
uint16_t size;
for(i=0;i<255;i++)
{
read[i]=i+1;
}
size = sizeof(read)/sizeof(read[0]);
componentsInit();
irqIsrEnable();
sd_lld_start(&SD2, &serial_config_cfg1);
if(sd_lld_write(&SD2,read,size) == SERIAL_MSG_OK)
{
pal_lld_setpad(PORT_C, PC_LED7);
osalThreadDelayMilliseconds(200);
}
return 0;
}My output looks like this. Lot of data are being missed on UART Transmission.
01
02
03
04
05
06
07
08
09
0a
0b
0c
0d
0e
0f
10
11
12
13
14
15
16
17
18
19
1a
1b
1c
1d
1e
1f
20
21
22
23
24
25
26
27
28
29
2a
2b
2c
2d
2e
2f
30
31
32
33
34
35
36
37
38
39
3a
3b
3c
3d
3e
3f
40
41
42
4c
64
7c
88
91
9b
a4
ae
b7
c0
ca
d3
dc
e7
f0
faAfter 0x42, I'm not receiving continuous stream of data, and much of the data are being missed in vain. Help me in debugging it.
Note:
- I have checked by transmitting uint32_t type data. Large portion of data is being skipped in this case as well.
- while debugging step by step, the tx interrupts are occurring correctly and I could retrieve without missing any data.
Thanks for your help in advance.
Prashanth Mohan
