m365fw / vesc_m365_dash

The VESC 6.0 Lisp implementation of the M365/NineBot BLE compability script
GNU General Public License v3.0
29 stars 6 forks source link

Uart big len data locks dashboard #2

Closed pinkflozd closed 1 year ago

pinkflozd commented 1 year ago

I tried to debug why the dash is locking up. Seems that the dash receives or sends a lot of data at once. when accelerating fast and with higher switching frequency.

(if (and (> len 0) (< len 10)) seems to fix it, i think it's because of the cpu spikes the dash receives a lot of data at once

(print len) output:

7
7
7
7
9
7
7
7
7
85
7
7
7
7
7
7
7
7
7

How to reproduce the dash bug: Set switching frequency to 45khz, connect with USB, enable live data, add a (print len), and try to hit the throttle fast, it happens on almost all fast throttles DON'T DO IT ON ROAD!

1zun4secondary commented 1 year ago

Yes. I have talked about this issue already with @vedderb on https://github.com/vedderb/bldc/issues/572 but have not fixed it yet. Now I can look into it. :)

1zun4secondary commented 1 year ago

The array buf is only size 64 and as soon it reads a len of 85 is being read it will crash.

1zun4secondary commented 1 year ago

Still need to test if this actually fixes the issue.

1zun4secondary commented 1 year ago

Tested now. It does fix the issue, but it one too high. I checked if len is equal less than 60, but it has to be less than 60.

image works fine.

image does.

Now changed it.