SC16is752 shared data between ports
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, linux
- Domain
- embedded-iot, operating-systems
Research direction
Start with the linked pingpong test app and reproduce the two-process setup using ttySC0/ttyUSB0 and ttySC1/ttyUSB1 at 115200 baud. Compare the received buffers after failures and trace the SC16IS752 serial handling to determine why bytes cross between ports. Done means both port pairs remain independent under concurrent use.
Written by the indexing model from the issue text.
Description
I have SC16IS752-based HAT connected throught SPI (Waveshare 2-CH RS485 and Inno-Maker rs485-can) . In the project, this HAT was bought for, I need to send modbus commands into 2 different ports independently. After very short amount of time, I have found that sometimes app reading answers from another port.
To prove that, test configuration was built.
Here is a config:
- RPi 3
- Waweshare 2-RS485-HAT (ttySC0 and tyySC1)
- 2x USB FT232RL-based RS485 sticks (ttyUSB0 and ttyUSB1)
$ cat /etc/rpi-issue
Raspberry Pi reference 2021-03-04
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 461109415073d2eb67083709662ba983cc191f14, stage2
$ vcgencmd version
Apr 30 2021 13:45:52
Copyright (c) 2012 Broadcom
version d7f29d96450abfc77cd6cf011af1faf1e03e5e56 (clean) (release) (start)
$ uname -a
Linux raspberrypi 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux
Both ports on the RPi HAT configured to full auto mode.
ttySC0 wired to ttyUSB0 and ttySC1 wired to ttyUSB1.
Test app source: https://gist.github.com/asp24/8602ca080f2a3c2b1ec2a99a52074c0b
Idea is very simple: write some predefined buffer to the ttySC0, read it from the ttyUSB0, write back to the ttyUSB0, read from the ttySC0 and compare with original buffer.
If I am running application only for 1 pair of the ports - everything works for a few days. But if app started for both pair of the ports,- one of them will fail shortly
# Starting two separate processes
./pingpong -port1 /dev/ttySC0 -port2 /dev/ttyUSB0 -sendMessage '(abcdefghijklmn)' -portSpeed 115200 &
./pingpong -port1 /dev/ttySC1 -port2 /dev/ttyUSB1 -sendMessage '[ABCDEFJHIJKLMN]' -portSpeed 115200 &
Here is several application outputs after failures
>> (abcdefghijklmn)
<< HIJKLMN]hijklmn)
>> (abcdefghijklmn)
<< (abcdefghijk[ABC
>> (abcdefghijklmn)
<< (abcdefgh[ABCDEF
As you can see, part of the data from SCx has been read from SCy. Sometimes broken in the same way data also sent from the port.
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·