-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Loss #47
Comments
Just had a thought that maybe it's only Pico W |
Did you use the sniffer example to sniff? I don't quite remember how it set it up (I added it to the repository mostly as historical material) but I remember that I was having trouble when printing during interrupts or "during capture". To get reliable output I needed to store the data received inside an array and then print it all after the execution. A sort of post-mortem analysis |
Yeah I tried that example, as well as my own. Submitted PR in #51 for the proof-of-concept projects. It would be great to have the discussions tab enabled to discuss possibilities. |
Ok I'll look into setting it up, thanks for the quick feedback! |
The issue appears to be in cmd_reader PIO program. I don't think you need the bit counter when autopush is enabled. Using the following psxSPI.pio is in sync and works for sniffing (doesn't ACK on purpose) |
The bit counter is needed in order to know when to ACK, but we can probably move the acking function to dat_writer and ACK each time we need to send something, it would probably be more logical and cleanup a lot of code. |
@dangiu It sounds good as long as we can choose to send the ACK (so we don't send after the last byte) |
When trying to sniff, it seems like data is disappearing and out of sync... I thought it was just my code, but it happens on yours, too.
Here we have 0x01 (Controller) 0x42 (Status)
We get a reply of 0xff, 0x73 (Device ID: 0x7 - DS Analog, Length: 0x3 UInt16s), 0x5a (Header End) - Perfect.
For the data section, we get 0xffff66 - expect something like 0xffff6661647b (as received second time)
The same thing is happening in my own code (using psxSPI.pio):
Initially I thought it might be because I was using printf() in the interrupt, but it seems to be happening with your example, too. Are you able to sniff without issues?
I'm wondering if I'm doing something wrong?
The text was updated successfully, but these errors were encountered: