Repository navigation
Conversation
|
Huh I didn't see that in my testing but I didn't do very long tests. Can you tell me exactly what hardware you're running again and which output channels you have set to dshot? I would like to try to reproduce it. No rush though because I will be gone for the rest of the week! |
|
I am using an RP4TD with uart pins cleared and set pwm pins 1,3,18,5.
Typically outputs set default w/changes:
1 50hz
2 50hz
3 Dshot
4 Dshot3D input ch2
I have a new RP4TD but all my other RX have esp8285.
…On Mon, Nov 24, 2025, 21:24 Bryan Mayland ***@***.***> wrote:
*CapnBry* left a comment (ExpressLRS/ExpressLRS#3417)
<#3417 (comment)>
Huh I didn't see that in my testing but I didn't do very long tests.
Can you tell me exactly what hardware you're running again and which
output channels you have set to dshot? I would like to try to reproduce it.
No rush though because I will be gone for the rest of the week!
—
Reply to this email directly, view it on GitHub
<#3417 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNT6YHHBQ7GAZTP246ML4L36O4WXAVCNFSM6AAAAACNBNU3Q2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZTGUZDSOBTHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
Thanks for the details, I'll be able to test it when I get back on Sunday. Flipping this to DRAFT PR since this needs to be resolved before merging. |
|
Looking at your capture though, I still see D3 and D4 showing activity even when the decoder shows no activity. Your sample rate is only 1MS though and I can't get any clean decodes at that rate, since the bit period would be 3.33 samples and it is likely it can't reliably pick up the bits in the packet at that rate (which have 1.25us 2.5us 0.83us and 2.08us pulses). I have to sample at 4MS at least before I start seeing valid CRCs all the time, and 8MS is closer to what is actually needed. That you said the ESC stopped seems to indicate there might be more to what you're saying, but on the SuperP I was testing with, I could run for minutes and not see any gap at all (although I didn't check all the CRCs), and again your D3/D4 area on the top shows things are still transmitting, so it seems like the PulseView decodes might not be a great indicator of if it is working. I do not know what AM32's requirements are for DSHOT packet frequency but less than 2ms would be ridiculously low. |
|
Sampling @ 4Mhz allows the pulseview decoder to read all DSHOT packets. Thank you @CapnBry ! I will try to do more testing over the next few days but here is what I have so far: I observe CRC errors only when throttle value is transitioning (ch4 Dshot3D) but I do not see any errors while throttle value remains constant. |
|
Which packet rate, switch mode, tlm ratio are you running? PWM spikes: this looks very much like crosstalk. Can you show a picture of how the logic analyzer is wired to the receiver. |
|
Very good points to question :-) Since mid October I have been using F1000, Wide, Std on my test hardware to help understand #2882 and #3248. Crosstalk was definitely an issue for spurious noise. The samples below were after some wiring clean up. Tests at 150Hz have made me more curios if we are able to get Dshot packets to send more regularly. |
|
I have pushed another commit to have accurate DShot300 1.25us/2.5us timing. I doubt it'll make a difference for your setup. But what the heck, why not have accurate timing. Here's 10s of trace data with properly shielded wires at 150Hz/Wide/Std. As far as I can see everything works great, all data frames decoded, no gaps, no errors: |
|
Thank you @mha1 , With 1820803 I see zero CRC error. However, still find sporadic dshot decode failures on my samples. All decode failures appear to have consistent packets of 14 bits instead of 16. My RP4TD PWM pins are 1,3,18,5 and I find incomplete packets... when ch3 Dshot and ch4 Dshot : In the next few days I will try another full erase and alternate RX configurations to see if I can get consistent complete dshot packets. |
|
This is reproducing Dshot = 00000110000000, Dshot3D = 00000000000000: No incomplete packets, no errors. Unfortunately I don't have a RP4-TD. @CapnBry has one and if he finds time he'll test this PR. Please attach your hardware.json file. Start WiFi and enter 10.0.0.1/hardware.json.
|
|
Removing the primary RX and TX pin assignments was triggering my sporadic 14bit Dshot packets. I see 100% 16 bit Dshot packets as long as RX and/or TX have pin assigned. example hardware.json that produces sporadic 14bit packets: I no longer suspect any problems with Dshot packets under this PR. |
|
Strangely, This round-robin code is way too fragile and not in obvious ways. The polling method also will make bidirectional dshot difficult to pull off, because the pin needs to switch to receive in under 26us from the last bit leaving the RMT and there's no guarantee of that given the polling loop system. That means we'll have to throw out a lot of this code for the next version, and there is no benefit to using this round-robin setup at this time (no hardware needs it) so I'm going to move to just revert #3140 and take another shot at this for 4.1. @pitts-mo I know that having the CRSF RX/TX pins filled in were the only way you were able to get reliable DSHOT, but that is for sure undefined behavior for our code. If the pins are used in the PWM pins list, then they must not appear as serial pins as well. Both sections of code will attempt to drive the pins and can result in sketchy behavior. If they are in the PWM list, then they can only be used as serial by setting their PWM function to serial. In your future hardware mods, make sure to not use the pins in both places, although I am kinda glad you tried that because this is certainly some weird behavior you've uncovered! |












Removes the extra 2 bits appearing in the DSHOT output after #3140. Also adjusts DSHOT 300 timing:
Bad DSHOT data
In addition to the bit timing being too short, there were extra bits appearing in the output of each frame. There should be 16 "high" sections in a DSHOT packet
The timing was also a little short, with each bit period being 0.13us too short and each "high" period being 0.10-0.15us too short. I don't believe this is an issue for ESCs but the decoder I downloaded for Logic didn't appreciate it so I've increased the all high bits and the bit period by 0.1us.
To fix the output, I just removed the
DSHOT_PAUSE_BIT, which was supposed to be a blank RMT item that assured there was a delay between each DSHOT packet when sent in hardware RMT looping mode. As the looping is now handled in software, the delay isn't needed as we can adjust the timing as we see fit. I have no idea what the original author of DShotRMT was smoking when they set the delay to10000 - (16*ticks_per_bit) - 1. The desired amount is 21 bit periods or 69.93us. That formula gives 9487 ticks or 948.7us or 0.9487ms. It should be justDSHOT_PAUSE * ticks_per_bit, which also fixed the bad DSHOT data, but again, we don't need the pause at this time. EDIT: Oh I figured it out. They were setting a 1ms looping period.RMT Busy Time
The RMT stays "busy" for 240us to 460us as measured by using another pin to flag the start of
output_rmt_data()to the time wherermt_wait_tx_done()doesn't return TIMEOUT any more. It is usually in the 240-250us range but there are some anomalies, possibly due to our giant packet-receiving ISR blocking the measurement code from executing. I swapped out all the existing 500us fixed delay andrmt_get_channel_status()for just querying the single channel's TX status since it seemed more direct. I did not test this on a C3-based RX though.DSHOT Packet Interleaving
The behavior of the old DSHOT use all the RMT units and just loop sending the output every 1ms. Now only one RMT is used and each channel is sent out every 2ms, or if it has been updated since the last send. This may present a logic analyzer trace that looks broken compared to the old behavior, but this should be fine for ESCs. Betaflight outputs DSHOT anywhere from 0.125us (8KHz) to 2ms (500Hz). This code operates up to 1KHz per ExpressLRS output and can probably do 4000 updates per second total (250Hz x 16 channels) but we might need to optimize a little to hit that.
Refactoring
This code needs some cleanup but in the interest of just trying to fix the bad output, I've only modified what was needed.