2024-12-04 07:33 AM - last edited on 2024-12-09 07:11 AM by SofLit
First of all I am not sure if this is the right location.
It wasn't: you posted under MPUs; moved to MCUs.
I have a custom PCB with an STM32H5 chip embedded.
This PCB needs to be a USB Host for a sensor that uses USB. If I connect the sensor to my laptop the sensor works fine, but when I have the sensor connected to the PCB. I doesn't work as expected.
We used an logic analyzer to see if there was any difference in the messages that were being send, but we don't see any difference, except for the address. In the images below, you can see the images. image(3) is the image from Laptop to the sensor. image(4) is the image from PCB to the sensor.
I used this library https://github.com/STMicroelectronics/stm32-mw-usb-host/tree/8b21b5c4a6b8df42ad46b9df63bb87c47bd7b2f5 as I want to be able to use FreeRTOS and not be stuck with ThreadX
Do you have any idea where I could look or what we might have done wrong or something we missed. I also included a .zip of the code as we have it right now.
If there is anything that I forgot to mention, please let me know.
2024-12-10 08:28 AM
Hi @Sara02
Would you attach detailed breakdown of the USB traffic. Could you confirm the sensor is enumerated as intended. If possible to visualize enumeration in IO Terminal or via HyperTerminal.
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.
2024-12-11 02:38 AM - edited 2024-12-12 12:54 AM
Hey @FBL,
I am using Linux, so Hyperterminal is no option as far as I see.
The IO terminal seems to need additional hardware.
Is this correct or am I missing something?
The enumeration looks like it goes right as far as I can see. When I check the settings they seem similar to what I see when I check it with the sensor connected to my laptop.
2024-12-12 05:57 AM
Hi @Sara02
You can use linux command line, for OUT direction, to send a file in binary form to COM port
bash -c 'cat filename >/dev/ttyACM0'
To receive data from the COM port ttyACM0 and discard it immediately, you can use the cat command as follows:
cat /dev/ttyACM0 >/dev/null
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.
2024-12-12 06:53 AM
Why should I use these commands on my laptop when I am trying to get the communication from my custom PCB with embedded STM32H5 chip to a USB sensor working?
Maybe this picture makes it more clear what I mean and how it should work.
If I connect the same sensor to my laptop it works. In that case the USB Host would be my laptop.
If I would add the captured data, you would see a working connection between my laptop and the sensor, of which we already know that it works. Or is there something else your looking for in the captured data?
2024-12-12 09:18 AM
Hi again @Sara02
I meant you use different UART instance apart from the one connected to the sensor to check if the enumeration is working. Otherwise, you can use USB sniffer. Can you share schematics of your custom PCB?
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.