2019-06-03 12:34 AM
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
fa
After 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:
Thanks for your help in advance.
Prashanth Mohan
2019-06-28 02:28 AM
Hello ,
Did you solve your issue ?
Have you tried to increase the stack size ?
Which device do you use ?
Best regards
Erwan
2019-06-28 03:02 AM
Hi Erwan,
Yes the issue is solved, the problem is the system clock of the other end is slower than the transmitting clock, I used a little bit delay before transmission of each byte and now I could retrieve the data safely.
Thanks.
Prashanth Mohan