Skip to content
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 no response on Serial* with high BAUDRATE #47

Merged
merged 1 commit into from
Jul 7, 2021
Merged

Conversation

mh-dm
Copy link
Contributor

@mh-dm mh-dm commented Jul 4, 2021

Fix no response on Serial* for LPC1768 (SKR v1.3) with BAUDRATE > 250000
Fix no response on Serial* for LPC1769 (SKR v1.4 Turbo) with BAUDRATE >= 1000000

Fix derived from MarlinFirmware/Marlin#22284 that was tested on Marlin with SERIAL_PORT 0 on SKR v1.3 and with SERIAL_PORT 0, 1, 3 on SKR v1.4 Turbo . With that fix verified 57600, 115200, 250000, 460800, 500000, 921600, 1000000 BAUDRATEs work.

Fix no response on Serial* for LPC1768 (SKR v1.3) with BAUDRATE > 250000
Fix no response on Serial* for LPC1769 (SKR v1.4 Turbo) with BAUDRATE >= 1000000

Fix derived from MarlinFirmware/Marlin#22284 that was tested on Marlin with SERIAL_PORT 0 on SKR v1.3 and with SERIAL_PORT 0, 1, 3 on SKR v1.4 Turbo . With that fix verified 57600, 115200, 250000, 460800, 500000, 921600, 1000000 BAUDRATEs work.
@mh-dm
Copy link
Contributor Author

mh-dm commented Jul 4, 2021

@p3p Note this patch is untested as I don't know the magic platformio incantation for platform and platform_packages to redirect it my local git repo or https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x/tree/patch-1
Currently I have:
platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip
platform_packages = framework-arduino-lpc176x@^0.2.6

@p3p
Copy link
Owner

p3p commented Jul 4, 2021

Hey thanks for finding this, I think you can use this syntax:
platform_packages = framework-arduino-lpc176x @ https://* to redirect to a specific package. I tend to just checkout my repository into platformios packages folder (~/.platformio/packages on linux) directly though.

@mh-dm
Copy link
Contributor Author

mh-dm commented Jul 5, 2021

First try, framework-arduino-lpc176x @ https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x/tree/patch-1:

Error: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1', 'https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x/tree/patch-1', '/home/mihai/.platformio/.cache/tmp/pkg-installing-zq21abgl']`

At least the error is self explanatory.

Second try, switch default branch and framework-arduino-lpc176x @ https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x.git:

ValueError: invalid literal for int() with base 10: '7+sha':
  File "/home/mihai/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 177:
    env.SConscript("$BUILD_SCRIPT")
[..]
  File "/home/mihai/.platformio/platforms/nxplpc-arduino-lpc176x/builder/main.py", line 27:
    framework_version = str(int(''.join(['{0:0=3d}'.format(int(x)) for x in platform.get_package_version('framework-arduino-lpc176x').split('.')]))) + 'UL'

Not sure what I was expecting.

There's no third try as "just checkout my repository into platformios packages folder" is exactly what the framework-arduino-lpc176x @ https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x.git configuration change did:

$ cd ~/.platformio/packages/framework-arduino-lpc176x/
$ git branch
* patch-1

But on the seventh try, when I hackily set framework_version = '2007' in ~/.platformio/packages/nxplpc-arduino-lpc176x/builder/main.py, hey it worked.

Tested (less exhaustively) this pull request works: SERIAL_PORT 0 and 1 SKR v1.3 BAUDRATE 921600 and SERIAL_PORT 0 SKR v1.4 turbo BAUDRATE 2000000.

Pull request ready to merge.

@p3p
Copy link
Owner

p3p commented Jul 5, 2021

PlatformIO must change the version string from .. well the version .. when you use a git link, my little hack to expose the framework version as a global define (so Marlin can see it) can't handle non numerics.

If you used the zip https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x/archive/refs/heads/patch-1.zip instead it probably would have worked as it should have used the normal version string.

Anyway thanks for testing, its a simple change I don't see any possible side effects so I don't see a problem merging .. although I've said that before and come to regret it ^^.

@mh-dm
Copy link
Contributor Author

mh-dm commented Jul 5, 2021

The framework-arduino-lpc176x @ https://[..].zip incantation worked, thanks!

Tool Manager: Installing https://github.com/mihai-dumitresq/pio-framework-arduino-lpc176x/archive/refs/heads/patch-1.zip
Downloading...
Tool Manager: framework-arduino-lpc176x @ 0.2.7 has been installed!

Anyway thanks for testing, its a simple change I don't see any possible side effects so I don't see a problem merging .. although I've said that before and come to regret it ^^.

It's a very small change and I've manually tested it. It'll be fine :)

@p3p p3p merged commit 3afb7ca into p3p:master Jul 7, 2021
@mh-dm
Copy link
Contributor Author

mh-dm commented Jul 7, 2021

Thank you!

@mh-dm mh-dm deleted the patch-1 branch May 21, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants