Skip to main content
TKara.2
Associate III
January 27, 2023
Question

I have a problem about data shifting and transmit

0693W00000Y9NJoQAN.png0693W00000Y9NJjQAN.pngdata needs to be in a row but there is shifting how can i fix this

This topic has been closed for replies.

9 replies

Tesla DeLorean
Guru
January 28, 2023

Your receiving program is adding the line breaks

Perhaps look at the threshold / reasons there

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
TKara.2
TKara.2Author
Associate III
January 28, 2023

Do u have suggestion for debugger I had test several programs and got same results

Tesla DeLorean
Guru
January 28, 2023

It is sending the data, looks to be all of it without missing any.

The breaks look more related to how the terminal synchronizes with the bursts of data as it receives them, and how it determines an end-of-transmission gap.

If you wrote the receiving side application your self, you could synchronize with the starting data pattern, and have expectations about the inter-message gaps.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal
January 28, 2023

How about totally changing the format you want to send data?

Output text which can be logged as Excel CSV format, so you can manipulate strings.

You can send your data in decimal format and use /0x0A /0x0D as string suffix as new CSV line.

TKara.2
TKara.2Author
Associate III
January 28, 2023

0693W00000Y9OYzQAN.png

TKara.2
TKara.2Author
Associate III
January 28, 2023

https://drive.google.com/file/d/1XgdyL_Z6iEcCKb7AZE4Rg4BcPWgLLxjb/view?usp=sharing

TKara.2
TKara.2Author
Associate III
January 28, 2023

You can see the problem in more detail here, the program crashes due to data shift.

Karl Yamashita
Principal
January 29, 2023

From what I see, you're using HAL_UART_Transmit which does not have interrupts. From your latest image it looks like the data is changing so that must mean you have other things going on. If there are other interrupts then they would have priority over the HAL_UART_Transmit. Those interrupts could cause a delay in transmitting the UART data in one continuous stream. Try using HAL_UART_Transmit_IT or HAL_UART_Transmit_DMA instead to see if that helps.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source