Skip to main content
SMich.1
Senior
September 3, 2020
Solved

Virtual UART data send M4 to A7 wrong data

  • September 3, 2020
  • 3 replies
  • 1340 views

call every 40mS :

static uint32_t count;

VIRT_UART_Transmit(cameraCommHandle.huart,(uint8_t *)&count,sizeof(count));

OPENAMP_check_for_message();

count++;

when i printing what i get in linux i got this:

39.99 ms: 262

40.00 ms: 263

40.01 ms: 264

40.00 ms: 265

40.00 ms: 266

39.99 ms: 267

40.00 ms: 268

40.01 ms: 266

40.00 ms: 270

40.00 ms: 271

39.99 ms: 272

40.00 ms: 1

40.01 ms: 274

40.00 ms: 1

40.00 ms: 276

39.99 ms: 277

40.00 ms: 278

and it repeat itself every 256 counts

i attached the c program that reads the serial and prints the what in UARt.

This topic has been closed for replies.
Best answer by SMich.1

Hi, the issue was at the flags config. one of the flag was that to take the bytes as console.

3 replies

SMich.1
SMich.1Author
Senior
September 3, 2020

one more test that i did : its prints 8bit counter with string and 16 bit of dummy.

root@stm32mp1-ground4-mx:/usr/csr/bin# ./read_trigger

971.24 ms: (104) 4 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.95 ms: (208) 5 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.96 ms: (312) 6 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

500.08 ms: (416) 7 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.91 ms: (520) 8 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

500.04 ms: (624) 9 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.96 ms: (728) 10 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

500.05 ms: (832) 11 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.96 ms: (936) 12 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

500.01 ms: (1040) 10 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

500.03 ms: (1144) 14 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.98 ms: (1248) 15 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.97 ms: (1352) 16 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

read 103 bytes instead of 104

500.04 ms: (1455) 97 0 - bcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.97 ms: (1559) 18 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

read 103 bytes instead of 104

500.02 ms: (1662) 97 0 - bcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

499.96 ms: (1766) 20 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

500.05 ms: (1870) 21 0 - abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst

Olivier GALLIEN
Technical Moderator
September 7, 2020

Hi @SMich.1​ 

This is some hint I received from expert.

In your code it could be worth to add a check that "rien==4 " to confirm success of read().

Also you can start to implement with further trace using the dynamic debug framework :

echo -n 'file virtio_rpmsg_bus.c +p' > /sys/kernel/debug/dynamic_debug/control

You will get a trace for all messages received by A7, helping to narrowing down where the issue may come from

Hope it help,

Olivier

Olivier GALLIEN In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
SMich.1
SMich.1AuthorAnswer
Senior
September 7, 2020

Hi, the issue was at the flags config. one of the flag was that to take the bytes as console.

Olivier GALLIEN
Technical Moderator
September 7, 2020

Hi @SMich.1​ 

Good news !

For reference could you please details further which flag you are talking about ?

Thx

Olivier

Olivier GALLIEN In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.