Skip to main content
added 5 characters in body; edited title
Source Link
brhans
  • 14.8k
  • 3
  • 36
  • 51

STM32F103 UART DMA transmitts curruptedtransmits corrupted data sometimes

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamiclydynamically calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.

P.S. I need to add that the problem is not constant but happens on 1 of the ~10-20 transfers. At the same time the corrupted packet looks everytimeevery time the same. I guess it related to that fact that request command also the same everytimeevery time.

STM32F103 UART DMA transmitts currupted data sometimes

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamicly calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.

P.S. I need to add that the problem is not constant but happens on 1 of the ~10-20 transfers. At the same time the corrupted packet looks everytime the same. I guess it related to that fact that request command also the same everytime

STM32F103 UART DMA transmits corrupted data sometimes

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamically calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.

P.S. I need to add that the problem is not constant but happens on 1 of the ~10-20 transfers. At the same time the corrupted packet looks every time the same. I guess it related to that fact that request command also the same every time.

added 236 characters in body
Source Link

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamicly calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.

P.S. I need to add that the problem is not constant but happens on 1 of the ~10-20 transfers. At the same time the corrupted packet looks everytime the same. I guess it related to that fact that request command also the same everytime

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamicly calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamicly calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.

P.S. I need to add that the problem is not constant but happens on 1 of the ~10-20 transfers. At the same time the corrupted packet looks everytime the same. I guess it related to that fact that request command also the same everytime

Source Link

STM32F103 UART DMA transmitts currupted data sometimes

I`m using STM32F103CBT6 core with UART via DMA on 9600 baud rate.

The device in idle state transfers data between controller and bill validator unit. In the same time I`m sniffing the data that are going there.

When I need to emulate the bill validator and send my own commands to the controller I just switching logical ICs (to break up the communication between them) and sending my own data to the USART 2.

My application works generally fine except one issue. I found out that sometimes the data seems to be corrupted. To show the issue I prepares some screenshots from the logic analyzer app:

Here is the correct data packet: The data packet that contains correct data

And here is the corrupted data packet: Corrupted one

Of course I tried to debug it with ST-Link but I saw that data array that is going to the HAL_UART_Transmit_DMA function is correct. I also tried to make an array to be const (as the original data packet`s CRC - last two bytes - are dynamicly calculated) but without success.

So here I`m sure that data that going to the HAL library is correct.

I don`t know where to search now but I guess that the problem is with DMA.

I didn`t received any data while transmitting on that UART, and sending new data packet way after the previous one was sent.