I tried to compile having uncomment #define BAUD_RATE_GCODE with atom and give me a error
Marlin\src\gcode\config\M575.cpp: In static member function 'static void GcodeSuite::M575()':
Marlin\src\gcode\config\M575.cpp:63:29: error: 'class CDCSerial' has no member named 'end'; did you mean 'read'?
if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); }
^~~
read
*** [.pioenvs\LPC1768\src\src\gcode\config\M575.cpp.o] Error 1
#define BAUD_RATE_GCODEExpected behavior: [What you expect to happen]
The program should compile
Actual behavior: [What actually happens]
Giving you a issue
Config files: https://drive.google.com/file/d/1NeOorUCouZbHFg-ZQ3KeaMGgSKxGxkEe/view?usp=sharing
I can confirm this issue with VSCode as well: pastebin log.
Try it here, you can not test it yourself.
\Marlin\src\gcode\config\M575.cpp
if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); }
#if NUM_SERIAL > 1
if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); }
#endif
to
#if NUM_SERIAL > 1
if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); }
#else
if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); }
#endif
Same error:
Marlin/src/gcode/config/M575.cpp: In static member function 'static void GcodeSuite::M575()':
Marlin/src/gcode/config/M575.cpp:64:31: error: 'class CDCSerial' has no member named 'end'; did you mean 'read'?
if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); }
^~~
read
I have no issue compiling with BAUD_RATE_GCODE enabled in VSCode and Arduino and without @Ludy87 's change
I have no issue compiling with BAUD_RATE_GCODE enabled in VSCode and Arduino and without @Ludy87 's change
You sure?
Using code I pulled down yesterday, I am still getting:
Marlin/src/gcode/config/M575.cpp: In static member function 'static void GcodeSuite::M575()':
Marlin/src/gcode/config/M575.cpp:66:31: error: 'class CDCSerial' has no member named 'end'; did you mean 'read'?
if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); }
^~~
read
I'll pull down the latest commits from a few minutes ago and rebase my fork and re-test.
Using the latest commit, I'm still getting the same error message.
That's strange, I'm using the latest commit as well.
It's probably some unique combination of enabled settings since I downloaded a vanilla config & it compiles with BAUD_RATE_GCODE enabled for LPC1768 and megaatmega2560. If I have time, I'll take my fork and start reverting settings until it compiles with BAUD_RATE_GCODE enabled to see where/why it's failing.
That's strange, I'm using the latest commit as well.
This will fail on anything except AVR and DUE. The platforms are missing the extended functions. He is using LPC1768 hence why he gets an error.
Since more M575 work is being done on in PR https://github.com/MarlinFirmware/Marlin/pull/14793, it's probably best to wait to see if those changes fix these issues.
@thisiskeithb Itll help for some platforms to be sure. Others will have to wait for platform support. P3P is aware of the change requested for lpc. Not sure if anyone is looking at libmaple / stm32 stuff yet. Time will tell. For now I have sanity checks for supported platforms in that PR. Ill be busy for a bit but ill get back to it soon enough.
i wonder if @Erokawa still have issues?
Yes, i'm still having it
Marlin\src\gcode\config\M575.cpp: In static member function 'static void GcodeSuite::M575()':
Marlin\src\gcode\config\M575.cpp:63:29: error: 'class CDCSerial' has no member named 'end'; did you mean 'read'?
if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); }
^~~
read
*** [.pio\build\LPC1768\src\src\gcode\config\M575.cpp.o] Error 1
PR fixing some is still sitting open. Its dead last on my list to work on as use cases for this are incredibly limited. To have a complete working implementation quite a bit is left to do. This will be open for awhile.
maybe link this issue in the PR? makes it tad more easy to see that a fix has been provided and we just need to wait for the merge... or is patience the word?
@Erokawa have you tried to compile with latest copy of marlin 2.0?
compiles fine on arduino ide 1.8.10

will try on vs code + platformio extension also
Doesnt matter, its current implementation is fundamentally broken for most platforms. A PR outlining what needs to be done is sitting, but given the extremely small potential user base and pile of other projects itll be awhile before I get back to it.
yeah i know about the PR... just figured if it would compile at all
It is also worth noting that changing the baud rate on a CDCSerial connection actually does nothing at all, the connectlon will always operate at full USB speed.
Oh and if someone is working on the various serial implementations, take a close look at exactly what the flush call does in each case. Unfortunately the Arduino implementation changed from version < 1 to version >= 1. The docs state:
Waits for the transmission of outgoing serial data to complete. (Prior to Arduino 1.0, this instead removed any buffered incoming serial data.)
Unfortunately the Marlin AVR HAL implementation of MarlinSerial does things the old way (as does the LPC176x Hal and framework), but I'm not sure if all HALs/frameworks will do things the same way.
A sanity check has been added to catch the option on unsupported platforms.
Unfortunately the Marlin AVR HAL implementation of MarlinSerial does things the old way…
It's tricky if people are using older and newer versions of Arduino IDE. We might have to enforce a minimum IDE version as part of updating our APIs.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@thisiskeithb Itll help for some platforms to be sure. Others will have to wait for platform support. P3P is aware of the change requested for lpc. Not sure if anyone is looking at libmaple / stm32 stuff yet. Time will tell. For now I have sanity checks for supported platforms in that PR. Ill be busy for a bit but ill get back to it soon enough.