cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L052 USB communication problems

skamlah
Associate
Posted on January 24, 2017 at 11:58

Hi,

I'm running in some communication problems with USB at the STM32L052 on Linux. If the device is connected via /dev/ttyACM0 and transmitting data to the host, I see an echo on the receive buffer inside the STM. If the host request another data packet than, the STM32 doesn't regconize the request.

Example:

STM is transmitting 'This is a test'. The STM receives several packets interrupts as:

1) 'This'

2) ' is '

3) 'a tes'

Lenght is except for the first packet always 4.

If the STM is connected as /dev/ttyACM1, everything is working fine. No echo is received.

Is there anything known?

Project is build with:

+ CubeMX 4.19.0

+ HAL-Lib STM32Cube_FW_L0_V1.7.0

+ Atollic TrueStudio

Kind regards

Siegfried Kamlah

3 REPLIES 3
Oliver Beirne
Senior
Posted on January 24, 2017 at 12:52

Hello

I have moved your thread to the

https://community.st.com/community/stm32-community/stm32-forum?sr=search&searchId=3432dd89-dcfd-4217-bdde-ec902fb8e8d9&searchIndex=0

‌ where someone should be able to assist you.

Thanks

Oli

Nor Sch
Associate III
Posted on January 26, 2017 at 10:51

This sounds like ttyACM0 is readen faster by your Linux as the ttyACM1. With small Timeslices in Reading the VCP you will get splitted Data. But I don't know where you can configure this. You will need some handling around your VCP-Data with Buffers and Syntax-/Content-Checking

skamlah
Associate
Posted on January 26, 2017 at 12:40

Found the reason for the effect: Inside the configuration file for openocd there was a STM32L1 selected, not a STM32L0. Now USB is running.