-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Fix multi-serial CRC error crash #21249
Merged
thinkyhead
merged 4 commits into
MarlinFirmware:bugfix-2.0.x
from
rhapsodyv:fix-multi-serial-on-error
Mar 4, 2021
Merged
Fix multi-serial CRC error crash #21249
thinkyhead
merged 4 commits into
MarlinFirmware:bugfix-2.0.x
from
rhapsodyv:fix-multi-serial-on-error
Mar 4, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rhapsodyv
force-pushed
the
fix-multi-serial-on-error
branch
from
March 4, 2021 15:24
4bfb5cd
to
610bd83
Compare
Bugfix is broken in more than one place... |
thinkyhead
changed the title
Fix crash on multi serial when a CRC error happen
Fix multi-serial CRC error crash
Mar 4, 2021
rmpel
added a commit
to rmpel/Marlin
that referenced
this pull request
Mar 5, 2021
* bugfix-2.0.x: (135 commits) Tweak tests, consolidate pins target validation (MarlinFirmware#21254) [cron] Bump distribution date (2021-03-05) Fix multi-serial CRC error crash (MarlinFirmware#21249) Followup to MP_SCARA/TPARA patches (MarlinFirmware#21248) Remove extra G42 Correct fan pins for MKS Robin Nano v3 (MarlinFirmware#21238) SMUFF => SMuFF (MarlinFirmware#21243) Implement G42, after all MK2_MULTIPLEXER dependency Update some py scripts Parking Extruder solenoid fix/cleanup Fix teensy35 tests [cron] Bump distribution date (2021-03-04) TPARA followup TPARA - 3DOF robot arm IK (MarlinFirmware#21005) misc. cleanup Improve opt_set (etc.) used for tests Fix MKS H43 compile (MarlinFirmware#21240) [cron] Bump distribution date (2021-03-03) Trust XY after Quiet Probing short sleep (MarlinFirmware#21237) ... # Conflicts: # Marlin/Configuration.h # Marlin/Configuration_adv.h
rmpel
added a commit
to rmpel/Marlin
that referenced
this pull request
Mar 6, 2021
* bugfix-2.0.x: (135 commits) Tweak tests, consolidate pins target validation (MarlinFirmware#21254) [cron] Bump distribution date (2021-03-05) Fix multi-serial CRC error crash (MarlinFirmware#21249) Followup to MP_SCARA/TPARA patches (MarlinFirmware#21248) Remove extra G42 Correct fan pins for MKS Robin Nano v3 (MarlinFirmware#21238) SMUFF => SMuFF (MarlinFirmware#21243) Implement G42, after all MK2_MULTIPLEXER dependency Update some py scripts Parking Extruder solenoid fix/cleanup Fix teensy35 tests [cron] Bump distribution date (2021-03-04) TPARA followup TPARA - 3DOF robot arm IK (MarlinFirmware#21005) misc. cleanup Improve opt_set (etc.) used for tests Fix MKS H43 compile (MarlinFirmware#21240) [cron] Bump distribution date (2021-03-03) Trust XY after Quiet Probing short sleep (MarlinFirmware#21237) ... # Conflicts: # Marlin/Configuration.h # Marlin/Configuration_adv.h
vyacheslav-shubin
pushed a commit
to vyacheslav-shubin/Marlin
that referenced
this pull request
Mar 10, 2021
vyacheslav-shubin
pushed a commit
to vyacheslav-shubin/Marlin
that referenced
this pull request
Mar 10, 2021
W4tel-BiDi
pushed a commit
to W4tel-BiDi/Marlin
that referenced
this pull request
Apr 5, 2021
thinkyhead
pushed a commit
that referenced
this pull request
Apr 30, 2021
rmpel
added a commit
to rmpel/Marlin
that referenced
this pull request
Feb 3, 2022
* bugfix-2.0.x: (135 commits) Tweak tests, consolidate pins target validation (MarlinFirmware#21254) [cron] Bump distribution date (2021-03-05) Fix multi-serial CRC error crash (MarlinFirmware#21249) Followup to MP_SCARA/TPARA patches (MarlinFirmware#21248) Remove extra G42 Correct fan pins for MKS Robin Nano v3 (MarlinFirmware#21238) SMUFF => SMuFF (MarlinFirmware#21243) Implement G42, after all MK2_MULTIPLEXER dependency Update some py scripts Parking Extruder solenoid fix/cleanup Fix teensy35 tests [cron] Bump distribution date (2021-03-04) TPARA followup TPARA - 3DOF robot arm IK (MarlinFirmware#21005) misc. cleanup Improve opt_set (etc.) used for tests Fix MKS H43 compile (MarlinFirmware#21240) [cron] Bump distribution date (2021-03-03) Trust XY after Quiet Probing short sleep (MarlinFirmware#21237) ... # Conflicts: # Marlin/Configuration.h
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
If we get a CRC error when using more than one serial, the old code inside
flush_and_request_resend
will get the wrong serial index fromring_buffer.command_port()
, because the current command wasn't queue yet.So I made it receive the index by parameter.
I was having another crash too, related with the parameterconst serial_index_t serial_ind
. For some strange reason, the compiler was optimising the array accessserial_state[serial_ind].last_N
using a non sense value forserial_ind
. The issue vanished when I started to use reference as parameter.Link the pictures showing the issue: #21010 (comment)Maybe it was a issue trigged by too many debugging sessions... or by wrong gcc optimisation... I don't know. If don't have pictures, I would not believe.After a full build, it seems solved the const/ref issue..
I'm attaching a simple script that I used to test the serial.
Benefits
More stable multi serial.
May fix #21010 and #21244
test-serial.py.txt