2024-01-28 03:49 AM
Hi
I use HID host as USB profile for getting barcode from scanner (ES4650 scanner).
I use STM32F746.
Most of the time I get the right barcode, but sometimes it misses a character .
I tried giving its interrupt the top priority, but it didn't solve the problem.
When trying the same scanner on a PC with a PC software, I always get the right barcode.
What can be the problem ?
Thanks
Ofer
2024-01-28 04:17 AM
Hi,
To check, whether there is a problem with the D-cache (if you have it on) , just switch off (or not enable) the D-cache.
2024-01-28 07:45 AM
Here is an old thread which you can check: https://community.st.com/t5/stm32-mcus-products/barcode-scanner-in-usb-hid/td-p/460686
Here are some barcode reading solutions. Some may become helpful to you.
If you ever try to make an ESPhome based barcode scanner, you can try this:
https://www.pcbway.com/project/shareproject/Barcode_scanner_made_for_ESPHome_bb9bba9a.html
2024-02-10 04:49 PM
Thank for your replies.
I solved this bug.
I uncommented all the 6-7 in my main loop and found that one of them caused the bug.
It was a function that read data from sensors (21 same temperature DS18S20 sensors).
Instead of reading all the 21 sensors every iteration I changed to read only one sensor on each iteration.
Those sensors and the USB are connected to the same 5V power supply.
The sensors which have 1-wire interface need a large pull-up so they probably affect somehow on the USB.
Thanks anyway.