Skip to content

Unable to upload code after update to 3.0.1 (invalid value '460800' for option 'UploadSpeed') #9786

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

Closed
1 task done
wangzongming opened this issue Jun 6, 2024 · 22 comments · Fixed by #10012
Closed
1 task done
Labels
Status: In Progress ⚠️ Issue is in progress
Milestone

Comments

@wangzongming
Copy link

Board

nodemcu-32s

Device Description

no

Hardware Configuration

Uploading any code results in an error

Version

latest master (checkout manually)

IDE Name

Arduino IED

Operating System

Window 11

Flash frequency

PSRAM enabled

yes

Upload speed

default

Description

Uploading the code will directly prompt the following error

I can't find a place on the menu bar where I can change the upload speed. Can you tell me how to change the speed?

It's similar to this problem:#8320

Invalid FQBN: getting build properties for board esp32:esp32:nodemcu-32s: invalid value '460800' for option 'UploadSpeed'

Compilation error: Invalid FQBN: getting build properties for board esp32:esp32:nodemcu-32s: invalid value '460800' for option 'UploadSpeed'

Sketch

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Debug Message

Invalid FQBN: getting build properties for board esp32:esp32:nodemcu-32s: invalid value '460800' for option 'UploadSpeed'

Compilation error: Invalid FQBN: getting build properties for board esp32:esp32:nodemcu-32s: invalid value '460800' for option 'UploadSpeed'

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@wangzongming wangzongming added the Status: Awaiting triage Issue is waiting for triage label Jun 6, 2024
@me-no-dev
Copy link
Member

460800 is marked as compatible only with Linux and Mac. Have you tried the other baudrates?

@wangzongming
Copy link
Author

wangzongming commented Jun 6, 2024

460800 is marked as compatible only with Linux and Mac. Have you tried the other baudrates?

Yes, I don't see 460800 baud rate on the serial port.

I don't see an option to set the speed in the arduino IDE(v2.3.2).
image

I tried to modify the contents of this file
\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\boards.txt
But nothing worked.

nodemcu-32s.menu.UploadSpeed.460800.linux=115200        <= this
nodemcu-32s.menu.UploadSpeed.460800.macosx=115200        <= this
nodemcu-32s.menu.UploadSpeed.460800.upload.speed=115200  <= this
nodemcu-32s.menu.UploadSpeed.115200=115200
nodemcu-32s.menu.UploadSpeed.115200.upload.speed=115200
nodemcu-32s.menu.UploadSpeed.256000.windows=256000
nodemcu-32s.menu.UploadSpeed.256000.upload.speed=256000
nodemcu-32s.menu.UploadSpeed.230400.windows.upload.speed=256000
nodemcu-32s.menu.UploadSpeed.230400=230400
nodemcu-32s.menu.UploadSpeed.230400.upload.speed=230400
nodemcu-32s.menu.UploadSpeed.512000.windows=512000
nodemcu-32s.menu.UploadSpeed.512000.upload.speed=512000
nodemcu-32s.menu.UploadSpeed.921600=921600
nodemcu-32s.menu.UploadSpeed.921600.upload.speed=921600

@wangzongming
Copy link
Author

I can upload the code after I fall back to version 2.0.17.

But I want to use ESP_SR, it seems that need 3.0 to have this library.

@wangzongming
Copy link
Author

Version 3.0.0 also does not report errors.

@me-no-dev
Copy link
Member

You should be able to see menu options there. Not sure why you do not. What happens if you select "ESP32 Dev Module"?

@me-no-dev
Copy link
Member

Screenshot 2024-06-06 at 8 51 30

This is on Mac

@wangzongming
Copy link
Author

image

You should be able to see menu options there. Not sure why you do not. What happens if you select "ESP32 Dev Module"?

There's no problem choosing this one. Thank you very much.🌹

Then I'll forget about the nodemcu-32s 🤣

@me-no-dev
Copy link
Member

@SuGlider can you check what you see about this board in IDE2.3.2 on Windows?

@per1234
Copy link
Contributor

per1234 commented Jun 6, 2024

The issue should be reopened since it is not resolved.

Background

The platform's board definitions are configured to cause specific custom board option items to be displayed in the Tools > Upload Speed menu only when Arduino IDE/Arduino CLI is running on a certain operating system. They are doing this by controlling whether the option name property is defined using the OS-specific override feature:

https://arduino.github.io/arduino-cli/dev/platform-specification/#automatic-property-override-for-specific-os

Since the code in the nodemcu-32s board definition is a bit messy, it might be difficult to understand from studying it, so I'll provide a simplified example of the use of this technique. Let's say I have a definition for a board with ID foo, which has a custom option menu bar, with option items pippo, pluto, and paperino. Normally it would look something like this:

menu.bar=Bar

foo.name=Foo
foo.menu.bar.pippo=Pippo
foo.menu.bar.pippo.asdf=1
foo.menu.bar.pluto=Pluto
foo.menu.bar.pluto.asdf=2
foo.menu.bar.paperino=Paperino
foo.menu.bar.paperino.asdf=3

[...]

However, if I changed the board definition to this:

menu.bar=Bar

foo.name=Foo
foo.menu.bar.pippo=Pippo
foo.menu.bar.pippo.asdf=1
foo.menu.bar.pluto.linux=Pluto
foo.menu.bar.pluto.macosx=Pluto
foo.menu.bar.pluto.asdf=2
foo.menu.bar.paperino.macos=Paperino
foo.menu.bar.paperino.asdf=3

[...]

Linux users would see the following options in the Tools > Bar menu:

  • Pippo
  • Pluto

macOS users would see these

  • Pippo
  • Pluto
  • Paperino

and Windows users would see this

  • Pippo

Explanation

Prior to the regression in #9277, Linux and macOS users would see the following items in the Tools > Upload Speed menu when the "NodeMCU-32S" board was selected:

  • 921600
  • 115200
  • 230400
  • 460800

while Windows users would see the following items:

  • 921600
  • 115200
  • 256000
  • 230400
  • 512000

(note the presence of "256000" and "512000" items and absence of "460800")

That worked fine until #9277 made the Linux/macOS-exclusive 460800 option the default by moving it to the top of the list in boards.txt. Arduino CLI automatically selects that default option regardless of operating system, which causes the board configuration to be invalid for Windows users since the use of OS-specific overrides in the 460800 option name definition property causes that property to not be defined on Windows machines.

Solution

A simple solution would be something like this:

--- a/boards.txt
+++ b/boards.txt
@@ -14434,8 +14434,7 @@ nodemcu-32s.menu.FlashFreq.80.build.flash_freq=80m
 nodemcu-32s.menu.FlashFreq.40=40MHz
 nodemcu-32s.menu.FlashFreq.40.build.flash_freq=40m

-nodemcu-32s.menu.UploadSpeed.460800.linux=460800
-nodemcu-32s.menu.UploadSpeed.460800.macosx=460800
+nodemcu-32s.menu.UploadSpeed.460800=460800

However, I guess there is a reason why the board definitions are configured to prevent Windows users from selecting a 460800 upload speed, which the naive solution shown above would allow.

If so, the best solution will be to set the default to the closest cross-platform speed, which is 230400:

--- a/boards.txt
+++ b/boards.txt
@@ -14434,6 +14434,9 @@ nodemcu-32s.menu.FlashFreq.80.build.flash_freq=80m
 nodemcu-32s.menu.FlashFreq.40=40MHz
 nodemcu-32s.menu.FlashFreq.40.build.flash_freq=40m

+nodemcu-32s.menu.UploadSpeed.230400.windows.upload.speed=256000
+nodemcu-32s.menu.UploadSpeed.230400=230400
+nodemcu-32s.menu.UploadSpeed.230400.upload.speed=230400
 nodemcu-32s.menu.UploadSpeed.460800.linux=460800
 nodemcu-32s.menu.UploadSpeed.460800.macosx=460800
 nodemcu-32s.menu.UploadSpeed.460800.upload.speed=460800
@@ -14441,9 +14444,6 @@ nodemcu-32s.menu.UploadSpeed.115200=115200
 nodemcu-32s.menu.UploadSpeed.115200.upload.speed=115200
 nodemcu-32s.menu.UploadSpeed.256000.windows=256000
 nodemcu-32s.menu.UploadSpeed.256000.upload.speed=256000
-nodemcu-32s.menu.UploadSpeed.230400.windows.upload.speed=256000
-nodemcu-32s.menu.UploadSpeed.230400=230400
-nodemcu-32s.menu.UploadSpeed.230400.upload.speed=230400
 nodemcu-32s.menu.UploadSpeed.512000.windows=512000
 nodemcu-32s.menu.UploadSpeed.512000.upload.speed=512000
 nodemcu-32s.menu.UploadSpeed.921600=921600

@per1234
Copy link
Contributor

per1234 commented Jun 6, 2024

Note that the nodemcu-32s.menu.UploadSpeed.230400.windows.upload.speed property has absolutely no effect (it defines a property named windows.upload.speed, which is not used anywhere). If the intention was to cause the upload.speed property value to be set to 256000 for Windows users, then it should have been written like this (the OS-specific override suffix must be placed at the end of the property name):

nodemcu-32s.menu.UploadSpeed.230400.upload.speed.windows=256000

and that property definition must be placed after the universal definition of the property so that it will work as an override:

nodemcu-32s.menu.UploadSpeed.230400.upload.speed=230400
nodemcu-32s.menu.UploadSpeed.230400.upload.speed.windows=256000

@per1234
Copy link
Contributor

per1234 commented Jun 8, 2024

@wangzongming @me-no-dev please reopen this valid, unresolved issue.

If I was confident in the validity of the solution I described in my previous comment, I would simply submit a pull request. However, I don't understand the reason why certain baud rates are only offered for specific operating systems so I don't think it would be responsible for me to do that.

So it will be important for this issue to be open so that the task of fixing the bug can be effectively tracked.

@wangzongming
Copy link
Author

@wangzongming @me-no-dev please reopen this valid, unresolved issue.

If I was confident in the validity of the solution I described in my previous comment, I would simply submit a pull request. However, I don't understand the reason why certain baud rates are only offered for specific operating systems so I don't think it would be responsible for me to do that.

So it will be important for this issue to be open so that the task of fixing the bug can be effectively tracked.

Okay, I'm sure you can handle it. Thanks.

@wangzongming wangzongming reopened this Jun 8, 2024
@Jason2866
Copy link
Collaborator

Since you are at the speed settings. I use 1500000 with all my boards and a Mac M1
Never had issues. Interestingly using 460800 does often fail.

@me-no-dev
Copy link
Member

As far as I remember 460800 was not compatible with Windows before. Limitation was introduced by Arduino and we just kept it the same. I am not a Windows user myself and have used 460800 only with S3 native USB CDC port.

@wangzongming
Copy link
Author

As far as I remember 460800 was not compatible with Windows before. Limitation was introduced by Arduino and we just kept it the same. I am not a Windows user myself and have used 460800 only with S3 native USB CDC port.

Yes, the latest Arduino IDE and the latest esp32 cannot appear together.
Otherwise selecting 'Nodemocu-32s' will not be available in Windows 11.

@dev-dakky
Copy link

Glad to know this is a current issue and not something I was messing up on my end. Using the esp32 dev module is an easy enough workaround in the meantime haha

@Armagedon13
Copy link

i have the same problem with 3.0.2 in windows 11.
look at the options, it doesn't have any. i reinstalled all, IDE and libraries, and nothing.
imagen

@xtremekratos
Copy link

xtremekratos commented Jun 30, 2024

well i have the exact same problem with v3.0.2 on IDE 2.3.2 in windows 11.
can't find any way to edit the upload speed

image

@Armagedon13
Copy link

well i have the exact same problem with v3.0.2 on IDE 2.3.2 in windows 11. can't find any way to edit the upload speed

image

try to use the module Node32s

@me-no-dev
Copy link
Member

Fix is coming: #10012

@VojtechBartoska VojtechBartoska added this to the 3.0.3 milestone Jul 11, 2024
@VojtechBartoska VojtechBartoska added Status: In Progress ⚠️ Issue is in progress and removed Status: Awaiting triage Issue is waiting for triage labels Jul 11, 2024
@WuChungPing
Copy link

WuChungPing commented Jul 29, 2024

try this~
nodemcu-32s.menu.UploadSpeed.460800=230400 <-add
nodemcu-32s.menu.UploadSpeed.460800.linux=460800
nodemcu-32s.menu.UploadSpeed.460800.macosx=460800
nodemcu-32s.menu.UploadSpeed.460800.upload.speed=230400 <-fix

esp32

@UltimaBear14
Copy link

nodemcu-32s.menu.UploadSpeed.460800.upload.speed=230400
Where do we put this line?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress ⚠️ Issue is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants